1 // Test that mixing instrumented and non-instrumented code doesn't lead to crash.
2 // Build two modules (one is instrumented, another is not) that have globals
3 // with same names. Check, that ASan doesn't crash with CHECK failure or
4 // false positive global-buffer-overflow due to sanitized library poisons
5 // globals from non-sanitized one.
7 // RUN: %clangxx_asan -DBUILD_INSTRUMENTED_DSO=1 -fPIC -shared -mllvm -asan-use-private-alias %s -o %dynamiclib1
8 // RUN: %clangxx -DBUILD_UNINSTRUMENTED_DSO=1 -fPIC -shared %s -o %dynamiclib2
9 // RUN: %clangxx %s -c -mllvm -asan-use-private-alias -o %t.o
10 // RUN: %clangxx_asan %t.o %ld_flags_rpath_exe2 %ld_flags_rpath_exe1 -o %t-EXE
13 #if defined (BUILD_INSTRUMENTED_DSO)
19 #elif defined (BUILD_UNINSTRUMENTED_DSO)
26 if (foo(&f
) != 5 || foo(&h
) != 12 || foo(&i
) != 13)