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
4
5// REQUIRES: pointer-tagging
6
7#include <stdlib.h>
8
9int x = 1;
10
11int 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(nptr: argv[1])] = 1;
16}
17

source code of compiler-rt/test/hwasan/TestCases/lto.c