[docs] Fix build-docs.sh
[llvm-project.git] / compiler-rt / test / hwasan / TestCases / lto.c
blob0f43877e89e3f53be8dc422d9eb3c382a73a5bc5
1 // Test globals with LTO, since it invokes the integrated assembler separately.
2 // RUN: %clang_hwasan -flto %s -o %t
3 // RUN: not %run %t 1 2>&1 | FileCheck %s
5 // REQUIRES: pointer-tagging, x86_64-target-arch
7 #include <stdlib.h>
9 int x = 1;
11 int main(int argc, char **argv) {
12 // CHECK: Cause: global-overflow
13 // CHECK: is located 0 bytes after a 4-byte global variable x {{.*}} in {{.*}}lto.c.tmp
14 // CHECK-NOT: can not describe
15 (&x)[atoi(argv[1])] = 1;