1 // If the binary looks up libraries using an rpath, we can't test this
2 // without copying the whole lib dir or polluting the build dir.
3 // REQUIRES: static-libs
5 // The above also applies if the binary is built with libc++.
6 // UNSUPPORTED: libcxx-used
10 // RUN: cp $(which llvm-symbolizer) %t.bin
13 // RUN: %clangxx -O0 %s -o %t && cd %t.dir
14 // RUN: %env_tool_opts=external_symbolizer_path=%d/external_symbolizer_path.cpp.tmp.bin/llvm-symbolizer \
15 // RUN: %run %t 2>&1 | FileCheck %s --check-prefix=FOUND
16 // RUN: rm -rf %t.bin/llvm-symbolizer
18 // RUN: %clangxx -O0 %s -o %t && cd %t.dir
19 // RUN: %env_tool_opts=external_symbolizer_path=%d/external_symbolizer_path.cpp.tmp.bin/llvm-symbolizer \
20 // RUN: %run %t 2>&1 | FileCheck %s --check-prefix=NOT-FOUND
24 // Mobile device will not have symbolizer in provided path.
25 // UNSUPPORTED: ios, android
27 // FIXME: Figure out why this fails on certain buildbots and re-enable.
28 // UNSUPPORTED: target={{.*linux.*}}
30 #include <sanitizer/common_interface_defs.h>
33 static void Symbolize() {
35 __sanitizer_symbolize_pc(__builtin_return_address(0), "%p %F %L", buffer
,
37 printf("%s\n", buffer
);
41 // FOUND: {{0x.* in main}}
42 // NOT-FOUND: WARNING: invalid path to external symbolizer!