25 lines · cpp
1// This test simply checks that the "Invalid dyld module map" warning is not printed2// in the output of a backtrace.3 4// RUN: %clangxx_asan -DSHARED_LIB -g %s -dynamiclib -o %t.dylib5// RUN: %clangxx_asan -O0 -g %s %t.dylib -o %t.executable6// RUN: %env_asan_opts="print_module_map=2" not %run %t.executable 2>&1 | FileCheck %s -DDYLIB=%{t:stem}.tmp.dylib7 8// CHECK-NOT: WARN: Invalid dyld module map9// CHECK-DAG: 0x{{.*}}-0x{{.*}} {{.*}}[[DYLIB]]10// CHECK-DAG: 0x{{.*}}-0x{{.*}} {{.*}}libsystem11 12#ifdef SHARED_LIB13extern "C" void foo(int *a) { *a = 5; }14#else15# include <cstdlib>16 17extern "C" void foo(int *a);18 19int main() {20 int *a = (int *)malloc(sizeof(int));21 free(a);22 foo(a);23 return 0;24}25#endif