brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 075c673 Raw
50 lines · cpp
1// RUN: %clangxx -O0 %s -o %t2 3// Recursive include: options1 includes options24// RUN: echo "symbolize=1" > %t.options1.txt5// RUN: echo "include='%t.options2.txt'" >>%t.options1.txt6// RUN: echo "help=1" >%t.options2.txt7// RUN: echo "help=1" >%t.options.options-include.cpp.tmp8// RUN: cat %t.options1.txt9// RUN: cat %t.options2.txt10 11// RUN: %env_tool_opts=help=0:include='"%t.options1.txt"' %run %t 2>&1 | tee %t.out12// RUN: FileCheck %s --check-prefix=CHECK-WITH-HELP --check-prefix=CHECK-FOUND <%t.out13 14// RUN: %env_tool_opts=include='"%t.options1.txt"',help=0 %run %t 2>&1 | tee %t.out15// RUN: FileCheck %s --check-prefix=CHECK-WITHOUT-HELP --check-prefix=CHECK-FOUND <%t.out16 17// RUN: %env_tool_opts=include='"%t.options-not-found.txt"',help=1 not %run %t 2>&1 | tee %t.out18// RUN: FileCheck %s --check-prefix=CHECK-NOT-FOUND < %t.out19 20// include_if_exists does not fail when the file is missing21// RUN: %env_tool_opts=include_if_exists='"%t.options-not-found.txt"',help=1 %run %t 2>&1 | tee %t.out22// RUN: FileCheck %s --check-prefix=CHECK-WITH-HELP --check-prefix=CHECK-FOUND < %t.out23 24// %b (binary basename substitution)25// RUN: %env_tool_opts=include='"%t.options.%b"' %run %t 2>&1 | tee %t.out26// RUN: FileCheck %s --check-prefix=CHECK-WITH-HELP --check-prefix=CHECK-FOUND < %t.out27 28// RUN: %env_tool_opts=include='"%t.options-not-found.%b"' not %run %t 2>&1 | tee %t.out29// RUN: FileCheck %s --check-prefix=CHECK-WITHOUT-HELP --check-prefix=CHECK-NOT-FOUND < %t.out30 31// RUN: %env_tool_opts=include_if_exists='"%t.options.%b"' %run %t 2>&1 | tee %t.out32// RUN: FileCheck %s --check-prefix=CHECK-WITH-HELP --check-prefix=CHECK-FOUND < %t.out33 34// RUN: %env_tool_opts=include_if_exists='"%t.options-not-found.%b"' %run %t 2>&1 | tee %t.out35// RUN: FileCheck %s --check-prefix=CHECK-WITHOUT-HELP --check-prefix=CHECK-FOUND < %t.out36 37// Android tests run on remote device so includes will not work.38// UNSUPPORTED: android39 40#include <stdio.h>41 42int main() {43  fprintf(stderr, "done\n");44}45 46// CHECK-WITH-HELP: Available flags for47// CHECK-WITHOUT-HELP-NOT: Available flags for48// CHECK-FOUND-NOT: Failed to read options from49// CHECK-NOT-FOUND: Failed to read options from50