| 1 | // Test that the DSO-local runtime library has been linked if -fxray-shared is passed. |
| 2 | // |
| 3 | // RUN: %clangxx -fxray-instrument -fxray-shared -fPIC %s -shared -o %t.so |
| 4 | // RUN: llvm-nm %t.so | FileCheck %s --check-prefix ENABLED |
| 5 | |
| 6 | // RUN: %clangxx -fxray-instrument %s -shared -o %t.so |
| 7 | // RUN: llvm-nm %t.so | FileCheck %s --check-prefix DISABLED |
| 8 | // |
| 9 | // REQUIRES: target={{(aarch64|x86_64)-.*}} |
| 10 | |
| 11 | [[clang::xray_always_instrument]] int always_instrumented() { return 42; } |
| 12 | |
| 13 | // ENABLED: __start_xray_instr_map |
| 14 | // DISABLED-NOT: __start_xray_instr_map |
| 15 | |