comparison compiler-rt/test/hwasan/TestCases/stack-oob.c @ 221:79ff65ed7e25

LLVM12 Original
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 15 Jun 2021 19:15:29 +0900
parents 1d019706d866
children 5f17cb93ff66
comparison
equal deleted inserted replaced
220:42394fc6a535 221:79ff65ed7e25
6 // RUN: %clang_hwasan -DSIZE=16 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s 6 // RUN: %clang_hwasan -DSIZE=16 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
7 // RUN: %clang_hwasan -DSIZE=64 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s 7 // RUN: %clang_hwasan -DSIZE=64 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
8 // RUN: %clang_hwasan -DSIZE=0x1000 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s 8 // RUN: %clang_hwasan -DSIZE=0x1000 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
9 9
10 // REQUIRES: stable-runtime 10 // REQUIRES: stable-runtime
11
12 // Stack aliasing is not implemented on x86.
13 // XFAIL: x86_64
11 14
12 #include <stdlib.h> 15 #include <stdlib.h>
13 #include <sanitizer/hwasan_interface.h> 16 #include <sanitizer/hwasan_interface.h>
14 17
15 __attribute__((noinline)) 18 __attribute__((noinline))
20 } 23 }
21 24
22 int main() { 25 int main() {
23 f(); 26 f();
24 // CHECK: READ of size 1 at 27 // CHECK: READ of size 1 at
25 // CHECK: #0 {{.*}} in f{{.*}}stack-oob.c:19 28 // CHECK: #0 {{.*}} in f{{.*}}stack-oob.c:[[@LINE-6]]
26 29
27 // CHECK: is located in stack of threa 30 // CHECK: is located in stack of threa
28 31
29 // CHECK: SUMMARY: HWAddressSanitizer: tag-mismatch {{.*}} in f 32 // CHECK: SUMMARY: HWAddressSanitizer: tag-mismatch {{.*}} in f
30 } 33 }