| 1 | /// Instrumented globals are added to llvm.compiler.used, so LTO will not const |
| 2 | /// merge them (which will cause spurious ODR violation). |
| 3 | // RUN: %clangxx_asan -O3 -fuse-ld=lld -flto %s -o %t |
| 4 | // RUN: %run %t 2>&1 |
| 5 | |
| 6 | // REQUIRES: lld-available, lto |
| 7 | |
| 8 | int main(int argc, const char * argv[]) { |
| 9 | struct { long width, height; } a = {.width: 16, .height: 16}; |
| 10 | struct { long width, height; } b = {.width: 16, .height: 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 | |