brintos

brintos / llvm-project-archived public Read only

0
0
Text · 502 B · 1370b5a Raw
17 lines · cpp
1/// Instrumented globals are added to llvm.compiler.used, so LTO will not const2/// merge them (which will cause spurious ODR violation).3// RUN: %clangxx_asan -O3 -fuse-ld=lld -flto %s -o %t4// RUN: %run %t 2>&15 6// REQUIRES: lld-available, lto7 8int main(int argc, const char * argv[]) {9  struct { long width, height; } a = {16, 16};10  struct { long width, height; } b = {16, 16};11 12  // Just to make sure 'a' and 'b' don't get optimized out.13  asm volatile("" : : "r" (&a), "r" (&b));14 15  return 0;16}17