annotate compiler-rt/test/hwasan/TestCases/global.c @ 223:5f17cb93ff66 llvm-original

LLVM13 (2021/7/18)
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:43:00 +0900
parents 79ff65ed7e25
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_hwasan %s -o %t
anatofuz
parents:
diff changeset
2 // RUN: %run %t 0
anatofuz
parents:
diff changeset
3 // RUN: not %run %t 1 2>&1 | FileCheck --check-prefixes=CHECK,RSYM %s
anatofuz
parents:
diff changeset
4 // RUN: not %env_hwasan_opts=symbolize=0 %run %t 1 2>&1 | FileCheck --check-prefixes=CHECK,RNOSYM %s
anatofuz
parents:
diff changeset
5 // RUN: not %run %t -1 2>&1 | FileCheck --check-prefixes=CHECK,LSYM %s
anatofuz
parents:
diff changeset
6 // RUN: not %env_hwasan_opts=symbolize=0 %run %t -1 2>&1 | FileCheck --check-prefixes=CHECK,LNOSYM %s
anatofuz
parents:
diff changeset
7
223
5f17cb93ff66 LLVM13 (2021/7/18)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 221
diff changeset
8 // REQUIRES: pointer-tagging
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
9
150
anatofuz
parents:
diff changeset
10 int x = 1;
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 int main(int argc, char **argv) {
223
5f17cb93ff66 LLVM13 (2021/7/18)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 221
diff changeset
13 // CHECK: Cause: global-overflow
150
anatofuz
parents:
diff changeset
14 // RSYM: is located 0 bytes to the right of 4-byte global variable x {{.*}} in {{.*}}global.c.tmp
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
15 // RNOSYM: is located to the right of a 4-byte global variable in ({{.*}}global.c.tmp+{{.*}})
150
anatofuz
parents:
diff changeset
16 // LSYM: is located 4 bytes to the left of 4-byte global variable x {{.*}} in {{.*}}global.c.tmp
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
17 // LNOSYM: is located to the left of a 4-byte global variable in ({{.*}}global.c.tmp+{{.*}})
150
anatofuz
parents:
diff changeset
18 // CHECK-NOT: can not describe
anatofuz
parents:
diff changeset
19 (&x)[atoi(argv[1])] = 1;
anatofuz
parents:
diff changeset
20 }