]>
git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/asan/TestCases/Linux/asan_preload_test-1.cc
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: LD_PRELOAD=%shared_libasan not %run %t 2>&1 | FileCheck %s
10 // REQUIRES: asan-dynamic-runtime
14 void do_access(const void *p
) {
15 // CHECK: AddressSanitizer: heap-buffer-overflow
16 dummy
= ((const char *)p
)[1];
20 extern void do_access(const void *p
);
21 int main(int argc
, char **argv
) {