27 lines · cpp
1// Test that mixed static/dynamic sanitization of program objects2// is prohibited.3//4// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %dynamiclib5// RUN: %clangxx_asan_static %s %ld_flags_rpath_exe -o %t6// RUN: not %run %t 2>&1 | FileCheck %s7 8// UNSUPPORTED: target={{.*}}9// REQUIRES: asan-dynamic-runtime10// XFAIL: android11 12#if BUILD_SO13char dummy;14void do_access(const void *p) { dummy = ((const char *)p)[1]; }15#else16#include <stdlib.h>17extern void do_access(const void *p);18int main(int argc, char **argv) {19 void *p = malloc(1);20 do_access(p);21 free(p);22 return 0;23}24#endif25 26// CHECK: Your application is linked against incompatible ASan runtimes27