1 // Test that non-sanitized executables work with sanitized shared libs
2 // and preloaded runtime.
4 // RUN: %clangxx -DBUILD_SO=1 -fPIC -shared %s -o %t.so
5 // RUN: %clangxx %s %t.so -o %t
7 // RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t.so
8 // RUN: env LD_PRELOAD=%shared_libasan not %run %t 2>&1 | FileCheck %s
10 // REQUIRES: asan-dynamic-runtime
12 // This way of setting LD_PRELOAD does not work with Android test runner.
17 void do_access(const void *p
) {
18 // CHECK: AddressSanitizer: heap-buffer-overflow
19 dummy
= ((const char *)p
)[1];
23 extern void do_access(const void *p
);
24 int main(int argc
, char **argv
) {