[CI][Github] Do not fail premerge job
[llvm-project.git] / compiler-rt / test / asan / TestCases / Linux / global-overflow-bfd.cpp
blob67331606c3ba0fdca62a07324c68dd3b6f09a554
1 // Test that gc-sections-friendly instrumentation of globals does not introduce
2 // false negatives with the BFD linker.
3 // RUN: %clangxx_asan -fuse-ld=bfd -Wl,-gc-sections -ffunction-sections -fdata-sections -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
5 // Android does not use bfd.
6 // UNSUPPORTED: android
8 #include <string.h>
9 int main(int argc, char **argv) {
10 static char XXX[10];
11 static char YYY[10];
12 static char ZZZ[10];
13 memset(XXX, 0, 10);
14 memset(YYY, 0, 10);
15 memset(ZZZ, 0, 10);
16 int res = YYY[argc * 10]; // BOOOM
17 // CHECK: {{READ of size 1 at}}
18 // CHECK: {{located 0 bytes after global variable}}
19 res += XXX[argc] + ZZZ[argc];
20 return res;