Daniel Dunbar | 83dd21f | 2009-03-13 17:57:10 +0000 | [diff] [blame] | 1 | // Basic compilation for various types of files. |
Daniel Dunbar | 7ec3daf | 2009-03-24 03:07:05 +0000 | [diff] [blame] | 2 | // RUN: clang -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 2> %t && |
Daniel Dunbar | 73bf6a9 | 2009-03-13 21:03:35 +0000 | [diff] [blame] | 3 | // RUN: grep '0: input, ".*phases.c", c' %t && |
Daniel Dunbar | 83dd21f | 2009-03-13 17:57:10 +0000 | [diff] [blame] | 4 | // 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 Dunbar | 73bf6a9 | 2009-03-13 21:03:35 +0000 | [diff] [blame] | 7 | // RUN: grep '4: input, ".*phases.c", objective-c' %t && |
Daniel Dunbar | 83dd21f | 2009-03-13 17:57:10 +0000 | [diff] [blame] | 8 | // 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 Dunbar | 73bf6a9 | 2009-03-13 21:03:35 +0000 | [diff] [blame] | 11 | // RUN: grep '8: input, ".*phases.c", c++' %t && |
Daniel Dunbar | 83dd21f | 2009-03-13 17:57:10 +0000 | [diff] [blame] | 12 | // 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 Dunbar | 73bf6a9 | 2009-03-13 21:03:35 +0000 | [diff] [blame] | 15 | // RUN: grep '12: input, ".*phases.c", assembler' %t && |
Daniel Dunbar | 83dd21f | 2009-03-13 17:57:10 +0000 | [diff] [blame] | 16 | // RUN: grep -F '13: assembler, {12}, object' %t && |
Daniel Dunbar | 73bf6a9 | 2009-03-13 21:03:35 +0000 | [diff] [blame] | 17 | // RUN: grep '14: input, ".*phases.c", assembler-with-cpp' %t && |
Daniel Dunbar | 83dd21f | 2009-03-13 17:57:10 +0000 | [diff] [blame] | 18 | // RUN: grep -F '15: preprocessor, {14}, assembler' %t && |
| 19 | // RUN: grep -F '16: assembler, {15}, object' %t && |
Daniel Dunbar | 73bf6a9 | 2009-03-13 21:03:35 +0000 | [diff] [blame] | 20 | // RUN: grep '17: input, ".*phases.c", c' %t && |
Daniel Dunbar | 83dd21f | 2009-03-13 17:57:10 +0000 | [diff] [blame] | 21 | // 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 Dunbar | 83df91b | 2009-03-13 20:45:03 +0000 | [diff] [blame] | 26 | // Universal linked image. |
Daniel Dunbar | 7ec3daf | 2009-03-24 03:07:05 +0000 | [diff] [blame] | 27 | // RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -x c %s -arch ppc -arch i386 2> %t && |
Daniel Dunbar | 73bf6a9 | 2009-03-13 21:03:35 +0000 | [diff] [blame] | 28 | // RUN: grep '0: input, ".*phases.c", c' %t && |
Daniel Dunbar | 83df91b | 2009-03-13 20:45:03 +0000 | [diff] [blame] | 29 | // 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. |
Daniel Dunbar | 7ec3daf | 2009-03-24 03:07:05 +0000 | [diff] [blame] | 38 | // RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x c %s -arch ppc -arch i386 2> %t && |
Daniel Dunbar | 73bf6a9 | 2009-03-13 21:03:35 +0000 | [diff] [blame] | 39 | // RUN: grep '0: input, ".*phases.c", c' %t && |
Daniel Dunbar | 83df91b | 2009-03-13 20:45:03 +0000 | [diff] [blame] | 40 | // 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 Dunbar | baf0775 | 2009-03-17 21:29:52 +0000 | [diff] [blame] | 47 | // Arch defaulting |
Daniel Dunbar | 7ec3daf | 2009-03-24 03:07:05 +0000 | [diff] [blame] | 48 | // RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s 2> %t && |
Daniel Dunbar | baf0775 | 2009-03-17 21:29:52 +0000 | [diff] [blame] | 49 | // RUN: grep -F '2: bind-arch, "i386", {1}, object' %t && |
Daniel Dunbar | 7ec3daf | 2009-03-24 03:07:05 +0000 | [diff] [blame] | 50 | // RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s -m32 -m64 2> %t && |
Daniel Dunbar | baf0775 | 2009-03-17 21:29:52 +0000 | [diff] [blame] | 51 | // RUN: grep -F '2: bind-arch, "x86_64", {1}, object' %t && |
Daniel Dunbar | 7ec3daf | 2009-03-24 03:07:05 +0000 | [diff] [blame] | 52 | // RUN: clang -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s 2> %t && |
Daniel Dunbar | baf0775 | 2009-03-17 21:29:52 +0000 | [diff] [blame] | 53 | // RUN: grep -F '2: bind-arch, "x86_64", {1}, object' %t && |
Daniel Dunbar | 7ec3daf | 2009-03-24 03:07:05 +0000 | [diff] [blame] | 54 | // RUN: clang -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s -m64 -m32 2> %t && |
Daniel Dunbar | baf0775 | 2009-03-17 21:29:52 +0000 | [diff] [blame] | 55 | // RUN: grep -F '2: bind-arch, "i386", {1}, object' %t && |
| 56 | |
Daniel Dunbar | 1a172b8 | 2009-03-17 23:26:35 +0000 | [diff] [blame] | 57 | // Analyzer |
Daniel Dunbar | 7ec3daf | 2009-03-24 03:07:05 +0000 | [diff] [blame] | 58 | // RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases --analyze %s 2> %t && |
Daniel Dunbar | 1a172b8 | 2009-03-17 23:26:35 +0000 | [diff] [blame] | 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 |
Daniel Dunbar | 7ec3daf | 2009-03-24 03:07:05 +0000 | [diff] [blame] | 64 | // RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -x c-header %s 2> %t && |
Daniel Dunbar | e247cba | 2009-03-17 23:30:47 +0000 | [diff] [blame] | 65 | // RUN: grep '0: input, ".*phases.c", c-header' %t && |
| 66 | // RUN: grep -F '1: preprocessor, {0}, c-header-cpp-output' %t && |
Daniel Dunbar | 1a172b8 | 2009-03-17 23:26:35 +0000 | [diff] [blame] | 67 | // RUN: grep -F '2: precompiler, {1}, precompiled-header' %t && |
| 68 | |
Daniel Dunbar | e33bea4 | 2009-03-20 23:39:23 +0000 | [diff] [blame] | 69 | // Darwin overrides the handling for .s |
| 70 | // RUN: touch %t.s && |
Daniel Dunbar | 7ec3daf | 2009-03-24 03:07:05 +0000 | [diff] [blame] | 71 | // RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -c %t.s 2> %t && |
Daniel Dunbar | e33bea4 | 2009-03-20 23:39:23 +0000 | [diff] [blame] | 72 | // RUN: grep '0: input, ".*\.s", assembler' %t && |
| 73 | // RUN: grep -F '1: assembler, {0}, object' %t && |
Daniel Dunbar | 7ec3daf | 2009-03-24 03:07:05 +0000 | [diff] [blame] | 74 | // RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c %t.s 2> %t && |
Daniel Dunbar | e33bea4 | 2009-03-20 23:39:23 +0000 | [diff] [blame] | 75 | // RUN: grep '0: input, ".*\.s", assembler-with-cpp' %t && |
| 76 | // RUN: grep -F '1: preprocessor, {0}, assembler' %t && |
| 77 | // RUN: grep -F '2: assembler, {1}, object' %t && |
| 78 | |
Daniel Dunbar | 83dd21f | 2009-03-13 17:57:10 +0000 | [diff] [blame] | 79 | // RUN: true |