[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / external_symbolizer_path.cpp
blob9416da2940be3f7a49942232ba350cdbeb4c70db
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
8 // RUN: rm -rf %t.bin
9 // RUN: mkdir %t.bin
10 // RUN: cp $(which llvm-symbolizer) %t.bin
11 // RUN: rm -rf %t.dir
12 // RUN: mkdir %t.dir
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
17 // RUN: cd ..
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
22 // REQUIRES: shell
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>
31 #include <stdio.h>
33 static void Symbolize() {
34 char buffer[100];
35 __sanitizer_symbolize_pc(__builtin_return_address(0), "%p %F %L", buffer,
36 sizeof(buffer));
37 printf("%s\n", buffer);
40 int main() {
41 // FOUND: {{0x.* in main}}
42 // NOT-FOUND: WARNING: invalid path to external symbolizer!
43 Symbolize();