1 // Test that we can properly report an ODR violation
2 // between an instrumented global and a non-instrumented global.
4 // RUN: %clang_asan %s -fPIC -shared -o %dynamiclib1 -DFILE1
5 // RUN: %clang_asan %s -fPIC -shared -o %dynamiclib2 -DFILE2
6 // RUN: %clang_asan %s -fPIE %ld_flags_rpath_exe1 %ld_flags_rpath_exe2 -o %t
7 // RUN: not %run %t 2>&1 | FileCheck %s
9 // CHECK: The following global variable is not properly aligned.
10 // CHECK: ERROR: AddressSanitizer: odr-violation
12 __attribute__((aligned(8))) int x;
13 __attribute__((aligned(1))) char y;
14 // The gold linker puts ZZZ at the start of bss (where it is aligned)
15 // unless we have a large alternative like Displace:
16 __attribute__((aligned(1))) char Displace[105];
17 __attribute__((aligned(1))) char ZZZ[100];