1 // A global constructor from a non-instrumented part calls a function
2 // in an instrumented part.
3 // Regression test for https://code.google.com/p/address-sanitizer/issues/detail?id=363.
5 // RUN: %clangxx -DINSTRUMENTED_PART=0 -c %s -o %t-uninst.o
6 // RUN: %clangxx_asan -DINSTRUMENTED_PART=1 -c %s -o %t-inst.o
7 // RUN: %clangxx_asan %t-uninst.o %t-inst.o -o %t
9 // RUN: %run %t 2>&1 | FileCheck %s
17 #if INSTRUMENTED_PART == 1
19 void func(char *ptr
) {
23 #else // INSTRUMENTED_PART == 1
28 char buffer
[10] = "world";
30 printf("%s\n", buffer
);
36 int main(int argc
, const char *argv
[]) {
40 #endif // INSTRUMENTED_PART == 1