Add an assert for safety check.
[clang.git] / test / Driver / bindings.c
blob3cac22c94be3c949800a45a5aeffb3ec4939d3a9
1 // Basic binding.
2 // RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings %s 2> %t &&
3 // RUN: grep '"clang", inputs: \[".*bindings.c"\], output: ".*\.s"' %t &&
4 // RUN: grep '"gcc::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t &&
5 // RUN: grep '"gcc::Link", inputs: \[".*\.o"\], output: "a.out"' %t &&
7 // RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang %s 2> %t &&
8 // RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: ".*\.s"' %t &&
9 // RUN: grep '"gcc::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t &&
10 // RUN: grep '"gcc::Link", inputs: \[".*\.o"\], output: "a.out"' %t &&
12 // RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -no-integrated-cpp %s 2> %t &&
13 // RUN: grep '"gcc::Preprocess", inputs: \[".*bindings.c"\], output: ".*\.i"' %t &&
14 // RUN: grep '"gcc::Compile", inputs: \[".*\.i"\], output: ".*\.s"' %t &&
15 // RUN: grep '"gcc::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t &&
16 // RUN: grep '"gcc::Link", inputs: \[".*\.o"\], output: "a.out"' %t &&
18 // RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -no-integrated-cpp -pipe %s 2> %t &&
19 // RUN: grep '"gcc::Preprocess", inputs: \[".*bindings.c"\], output: (pipe)' %t &&
20 // RUN: grep '"gcc::Compile", inputs: \[(pipe)\], output: (pipe)' %t &&
21 // RUN: grep '"gcc::Assemble", inputs: \[(pipe)\], output: ".*\.o"' %t &&
22 // RUN: grep '"gcc::Link", inputs: \[".*\.o"\], output: "a.out"' %t &&
24 // RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -x c-header %s 2> %t &&
25 // RUN: grep '"gcc::Precompile", inputs: \[".*bindings.c"\], output: ".*bindings.c.gch' %t &&
27 // Clang control options
29 // RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -fsyntax-only %s 2> %t &&
30 // RUN: grep '"clang", inputs: \[".*bindings.c"\], output: (nothing)' %t &&
31 // RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang -fsyntax-only %s 2> %t &&
32 // RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: (nothing)' %t &&
33 // RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -fsyntax-only -x c++ %s 2> %t &&
34 // RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: (nothing)' %t &&
35 // RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-clang-cxx -fsyntax-only -x c++ %s 2> %t &&
36 // RUN: grep '"clang", inputs: \[".*bindings.c"\], output: (nothing)' %t &&
37 // RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-bindings -ccc-no-clang-cpp -fsyntax-only -no-integrated-cpp %s 2> %t &&
38 // RUN: grep '"gcc::Preprocess", inputs: \[".*bindings.c"\], output: ".*\.i"' %t &&
39 // RUN: grep '"clang", inputs: \[".*\.i"\], output: (nothing)' %t &&
40 // RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-bindings -ccc-clang-archs i386 %s -S -arch ppc 2> %t &&
41 // RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: "bindings.s"' %t &&
42 // RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-bindings -ccc-clang-archs ppc %s -S -arch ppc 2> %t &&
43 // RUN: grep '"clang", inputs: \[".*bindings.c"\], output: "bindings.s"' %t &&
45 // RUN: clang -ccc-host-triple powerpc-unknown-unknown -ccc-print-bindings -ccc-clang-archs "" %s -S 2> %t &&
46 // RUN: grep '"clang", inputs: \[".*bindings.c"\], output: "bindings.s"' %t &&
47 // RUN: clang -ccc-host-triple powerpc-unknown-unknown -ccc-print-bindings %s -S 2> %t &&
48 // RUN: grep '"gcc::Compile", inputs: \[".*bindings.c"\], output: "bindings.s"' %t &&
50 // Darwin bindings
51 // RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-bindings %s 2> %t &&
52 // RUN: grep '"clang", inputs: \[".*bindings.c"\], output: ".*\.s"' %t &&
53 // RUN: grep '"darwin::Assemble", inputs: \[".*\.s"\], output: ".*\.o"' %t &&
54 // RUN: grep '"darwin::Link", inputs: \[".*\.o"\], output: "a.out"' %t &&
56 // RUN: true