blob: 3d5677bc88aef82ba57ca721c07890222dc0f963 [file] [log] [blame]
Daniel Dunbar83dd21f2009-03-13 17:57:10 +00001// Basic compilation for various types of files.
2// RUN: clang-driver -ccc-host-triple i386-unknown-unknown -ccc-print-phases -x c %s -x objective-c %s -x c++ %s -x objective-c++ -x assembler %s -x assembler-with-cpp %s -x none %s &> %t &&
Daniel Dunbar73bf6a92009-03-13 21:03:35 +00003// RUN: grep '0: input, ".*phases.c", c' %t &&
Daniel Dunbar83dd21f2009-03-13 17:57:10 +00004// RUN: grep -F '1: preprocessor, {0}, cpp-output' %t &&
5// RUN: grep -F '2: compiler, {1}, assembler' %t &&
6// RUN: grep -F '3: assembler, {2}, object' %t &&
Daniel Dunbar73bf6a92009-03-13 21:03:35 +00007// RUN: grep '4: input, ".*phases.c", objective-c' %t &&
Daniel Dunbar83dd21f2009-03-13 17:57:10 +00008// RUN: grep -F '5: preprocessor, {4}, objective-c-cpp-output' %t &&
9// RUN: grep -F '6: compiler, {5}, assembler' %t &&
10// RUN: grep -F '7: assembler, {6}, object' %t &&
Daniel Dunbar73bf6a92009-03-13 21:03:35 +000011// RUN: grep '8: input, ".*phases.c", c++' %t &&
Daniel Dunbar83dd21f2009-03-13 17:57:10 +000012// RUN: grep -F '9: preprocessor, {8}, c++-cpp-output' %t &&
13// RUN: grep -F '10: compiler, {9}, assembler' %t &&
14// RUN: grep -F '11: assembler, {10}, object' %t &&
Daniel Dunbar73bf6a92009-03-13 21:03:35 +000015// RUN: grep '12: input, ".*phases.c", assembler' %t &&
Daniel Dunbar83dd21f2009-03-13 17:57:10 +000016// RUN: grep -F '13: assembler, {12}, object' %t &&
Daniel Dunbar73bf6a92009-03-13 21:03:35 +000017// RUN: grep '14: input, ".*phases.c", assembler-with-cpp' %t &&
Daniel Dunbar83dd21f2009-03-13 17:57:10 +000018// RUN: grep -F '15: preprocessor, {14}, assembler' %t &&
19// RUN: grep -F '16: assembler, {15}, object' %t &&
Daniel Dunbar73bf6a92009-03-13 21:03:35 +000020// RUN: grep '17: input, ".*phases.c", c' %t &&
Daniel Dunbar83dd21f2009-03-13 17:57:10 +000021// RUN: grep -F '18: preprocessor, {17}, cpp-output' %t &&
22// RUN: grep -F '19: compiler, {18}, assembler' %t &&
23// RUN: grep -F '20: assembler, {19}, object' %t &&
24// RUN: grep -F '21: linker, {3, 7, 11, 13, 16, 20}, image' %t &&
25
Daniel Dunbar83df91b2009-03-13 20:45:03 +000026// Universal linked image.
27// RUN: clang-driver -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -x c %s -arch ppc -arch i386 &> %t &&
Daniel Dunbar73bf6a92009-03-13 21:03:35 +000028// RUN: grep '0: input, ".*phases.c", c' %t &&
Daniel Dunbar83df91b2009-03-13 20:45:03 +000029// RUN: grep -F '1: preprocessor, {0}, cpp-output' %t &&
30// RUN: grep -F '2: compiler, {1}, assembler' %t &&
31// RUN: grep -F '3: assembler, {2}, object' %t &&
32// RUN: grep -F '4: linker, {3}, image' %t &&
33// RUN: grep -F '5: bind-arch, "ppc", {4}, image' %t &&
34// RUN: grep -F '6: bind-arch, "i386", {4}, image' %t &&
35// RUN: grep -F '7: lipo, {5, 6}, image' %t &&
36
37// Universal object file.
38// RUN: clang-driver -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x c %s -arch ppc -arch i386 &> %t &&
Daniel Dunbar73bf6a92009-03-13 21:03:35 +000039// RUN: grep '0: input, ".*phases.c", c' %t &&
Daniel Dunbar83df91b2009-03-13 20:45:03 +000040// RUN: grep -F '1: preprocessor, {0}, cpp-output' %t &&
41// RUN: grep -F '2: compiler, {1}, assembler' %t &&
42// RUN: grep -F '3: assembler, {2}, object' %t &&
43// RUN: grep -F '4: bind-arch, "ppc", {3}, object' %t &&
44// RUN: grep -F '5: bind-arch, "i386", {3}, object' %t &&
45// RUN: grep -F '6: lipo, {4, 5}, object' %t &&
46
Daniel Dunbarbaf07752009-03-17 21:29:52 +000047// Arch defaulting
48// RUN: clang-driver -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s &> %t &&
49// RUN: grep -F '2: bind-arch, "i386", {1}, object' %t &&
50// RUN: clang-driver -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s -m32 -m64 &> %t &&
51// RUN: grep -F '2: bind-arch, "x86_64", {1}, object' %t &&
52// RUN: clang-driver -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s &> %t &&
53// RUN: grep -F '2: bind-arch, "x86_64", {1}, object' %t &&
54// RUN: clang-driver -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s -m64 -m32 &> %t &&
55// RUN: grep -F '2: bind-arch, "i386", {1}, object' %t &&
56
Daniel Dunbar1a172b82009-03-17 23:26:35 +000057// Analyzer
58// RUN: clang-driver -ccc-host-triple i386-unknown-unknown -ccc-print-phases --analyze %s &> %t &&
59// RUN: grep '0: input, ".*phases.c", c' %t &&
60// RUN: grep -F '1: preprocessor, {0}, cpp-output' %t &&
61// RUN: grep -F '2: analyzer, {1}, plist' %t &&
62
63// Precompiler
64// RUN: clang-driver -ccc-host-triple i386-unknown-unknown -ccc-print-phases -x c-header %s &> %t &&
65// RUN: grep '0: input, ".*phases.c", c' %t &&
66// RUN: grep -F '1: preprocessor, {0}, cpp-output' %t &&
67// RUN: grep -F '2: precompiler, {1}, precompiled-header' %t &&
68
69// RUN: clang-driver
Daniel Dunbar83dd21f2009-03-13 17:57:10 +000070// RUN: true