[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / options-include.cpp
blob075c6737c82a2366ff496072542d2754125c7320
1 // RUN: %clangxx -O0 %s -o %t
3 // Recursive include: options1 includes options2
4 // RUN: echo "symbolize=1" > %t.options1.txt
5 // RUN: echo "include='%t.options2.txt'" >>%t.options1.txt
6 // RUN: echo "help=1" >%t.options2.txt
7 // RUN: echo "help=1" >%t.options.options-include.cpp.tmp
8 // RUN: cat %t.options1.txt
9 // RUN: cat %t.options2.txt
11 // RUN: %env_tool_opts=help=0:include='"%t.options1.txt"' %run %t 2>&1 | tee %t.out
12 // RUN: FileCheck %s --check-prefix=CHECK-WITH-HELP --check-prefix=CHECK-FOUND <%t.out
14 // RUN: %env_tool_opts=include='"%t.options1.txt"',help=0 %run %t 2>&1 | tee %t.out
15 // RUN: FileCheck %s --check-prefix=CHECK-WITHOUT-HELP --check-prefix=CHECK-FOUND <%t.out
17 // RUN: %env_tool_opts=include='"%t.options-not-found.txt"',help=1 not %run %t 2>&1 | tee %t.out
18 // RUN: FileCheck %s --check-prefix=CHECK-NOT-FOUND < %t.out
20 // include_if_exists does not fail when the file is missing
21 // RUN: %env_tool_opts=include_if_exists='"%t.options-not-found.txt"',help=1 %run %t 2>&1 | tee %t.out
22 // RUN: FileCheck %s --check-prefix=CHECK-WITH-HELP --check-prefix=CHECK-FOUND < %t.out
24 // %b (binary basename substitution)
25 // RUN: %env_tool_opts=include='"%t.options.%b"' %run %t 2>&1 | tee %t.out
26 // RUN: FileCheck %s --check-prefix=CHECK-WITH-HELP --check-prefix=CHECK-FOUND < %t.out
28 // RUN: %env_tool_opts=include='"%t.options-not-found.%b"' not %run %t 2>&1 | tee %t.out
29 // RUN: FileCheck %s --check-prefix=CHECK-WITHOUT-HELP --check-prefix=CHECK-NOT-FOUND < %t.out
31 // RUN: %env_tool_opts=include_if_exists='"%t.options.%b"' %run %t 2>&1 | tee %t.out
32 // RUN: FileCheck %s --check-prefix=CHECK-WITH-HELP --check-prefix=CHECK-FOUND < %t.out
34 // RUN: %env_tool_opts=include_if_exists='"%t.options-not-found.%b"' %run %t 2>&1 | tee %t.out
35 // RUN: FileCheck %s --check-prefix=CHECK-WITHOUT-HELP --check-prefix=CHECK-FOUND < %t.out
37 // Android tests run on remote device so includes will not work.
38 // UNSUPPORTED: android
40 #include <stdio.h>
42 int main() {
43 fprintf(stderr, "done\n");
46 // CHECK-WITH-HELP: Available flags for
47 // CHECK-WITHOUT-HELP-NOT: Available flags for
48 // CHECK-FOUND-NOT: Failed to read options from
49 // CHECK-NOT-FOUND: Failed to read options from