Daniel Dunbar | 83dd21f | 2009-03-13 17:57:10 +0000 | [diff] [blame] | 1 | // Basic compilation for various types of files. |
Sebastian Pop | 9ec60df | 2012-01-20 22:01:23 +0000 | [diff] [blame] | 2 | // RUN: %clang -target 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>&1 | FileCheck -check-prefix=BASIC %s |
Sebastian Redl | a98c034 | 2009-10-26 18:07:30 +0000 | [diff] [blame] | 3 | // BASIC: 0: input, "{{.*}}phases.c", c |
| 4 | // BASIC: 1: preprocessor, {0}, cpp-output |
| 5 | // BASIC: 2: compiler, {1}, assembler |
| 6 | // BASIC: 3: assembler, {2}, object |
| 7 | // BASIC: 4: input, "{{.*}}phases.c", objective-c |
| 8 | // BASIC: 5: preprocessor, {4}, objective-c-cpp-output |
| 9 | // BASIC: 6: compiler, {5}, assembler |
| 10 | // BASIC: 7: assembler, {6}, object |
| 11 | // BASIC: 8: input, "{{.*}}phases.c", c++ |
| 12 | // BASIC: 9: preprocessor, {8}, c++-cpp-output |
| 13 | // BASIC: 10: compiler, {9}, assembler |
| 14 | // BASIC: 11: assembler, {10}, object |
| 15 | // BASIC: 12: input, "{{.*}}phases.c", assembler |
| 16 | // BASIC: 13: assembler, {12}, object |
| 17 | // BASIC: 14: input, "{{.*}}phases.c", assembler-with-cpp |
| 18 | // BASIC: 15: preprocessor, {14}, assembler |
| 19 | // BASIC: 16: assembler, {15}, object |
| 20 | // BASIC: 17: input, "{{.*}}phases.c", c |
| 21 | // BASIC: 18: preprocessor, {17}, cpp-output |
| 22 | // BASIC: 19: compiler, {18}, assembler |
| 23 | // BASIC: 20: assembler, {19}, object |
| 24 | // BASIC: 21: linker, {3, 7, 11, 13, 16, 20}, image |
Daniel Dunbar | 83dd21f | 2009-03-13 17:57:10 +0000 | [diff] [blame] | 25 | |
Daniel Dunbar | 83df91b | 2009-03-13 20:45:03 +0000 | [diff] [blame] | 26 | // Universal linked image. |
Sebastian Pop | 9ec60df | 2012-01-20 22:01:23 +0000 | [diff] [blame] | 27 | // RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=ULI %s |
Sebastian Redl | a98c034 | 2009-10-26 18:07:30 +0000 | [diff] [blame] | 28 | // ULI: 0: input, "{{.*}}phases.c", c |
| 29 | // ULI: 1: preprocessor, {0}, cpp-output |
| 30 | // ULI: 2: compiler, {1}, assembler |
| 31 | // ULI: 3: assembler, {2}, object |
| 32 | // ULI: 4: linker, {3}, image |
| 33 | // ULI: 5: bind-arch, "ppc", {4}, image |
| 34 | // ULI: 6: bind-arch, "i386", {4}, image |
| 35 | // ULI: 7: lipo, {5, 6}, image |
Daniel Dunbar | 83df91b | 2009-03-13 20:45:03 +0000 | [diff] [blame] | 36 | |
| 37 | // Universal object file. |
Sebastian Pop | 9ec60df | 2012-01-20 22:01:23 +0000 | [diff] [blame] | 38 | // RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -c -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=UOF %s |
Sebastian Redl | a98c034 | 2009-10-26 18:07:30 +0000 | [diff] [blame] | 39 | // UOF: 0: input, "{{.*}}phases.c", c |
| 40 | // UOF: 1: preprocessor, {0}, cpp-output |
| 41 | // UOF: 2: compiler, {1}, assembler |
| 42 | // UOF: 3: assembler, {2}, object |
| 43 | // UOF: 4: bind-arch, "ppc", {3}, object |
| 44 | // UOF: 5: bind-arch, "i386", {3}, object |
| 45 | // UOF: 6: lipo, {4, 5}, object |
Daniel Dunbar | 83df91b | 2009-03-13 20:45:03 +0000 | [diff] [blame] | 46 | |
Daniel Dunbar | baf0775 | 2009-03-17 21:29:52 +0000 | [diff] [blame] | 47 | // Arch defaulting |
Sebastian Pop | 9ec60df | 2012-01-20 22:01:23 +0000 | [diff] [blame] | 48 | // RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH1 %s |
Sebastian Redl | a98c034 | 2009-10-26 18:07:30 +0000 | [diff] [blame] | 49 | // ARCH1: 2: bind-arch, "i386", {1}, object |
Sebastian Pop | 9ec60df | 2012-01-20 22:01:23 +0000 | [diff] [blame] | 50 | // RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -c -x assembler %s -m32 -m64 2>&1 | FileCheck -check-prefix=ARCH2 %s |
Sebastian Redl | a98c034 | 2009-10-26 18:07:30 +0000 | [diff] [blame] | 51 | // ARCH2: 2: bind-arch, "x86_64", {1}, object |
Sebastian Pop | 9ec60df | 2012-01-20 22:01:23 +0000 | [diff] [blame] | 52 | // RUN: %clang -target x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH3 %s |
Sebastian Redl | a98c034 | 2009-10-26 18:07:30 +0000 | [diff] [blame] | 53 | // ARCH3: 2: bind-arch, "x86_64", {1}, object |
Sebastian Pop | 9ec60df | 2012-01-20 22:01:23 +0000 | [diff] [blame] | 54 | // RUN: %clang -target x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s -m64 -m32 2>&1 | FileCheck -check-prefix=ARCH4 %s |
Sebastian Redl | a98c034 | 2009-10-26 18:07:30 +0000 | [diff] [blame] | 55 | // ARCH4: 2: bind-arch, "i386", {1}, object |
Daniel Dunbar | baf0775 | 2009-03-17 21:29:52 +0000 | [diff] [blame] | 56 | |
Daniel Dunbar | 1a172b8 | 2009-03-17 23:26:35 +0000 | [diff] [blame] | 57 | // Analyzer |
Sebastian Pop | 9ec60df | 2012-01-20 22:01:23 +0000 | [diff] [blame] | 58 | // RUN: %clang -target i386-unknown-unknown -ccc-print-phases --analyze %s 2>&1 | FileCheck -check-prefix=ANALYZE %s |
Sebastian Redl | a98c034 | 2009-10-26 18:07:30 +0000 | [diff] [blame] | 59 | // ANALYZE: 0: input, "{{.*}}phases.c", c |
| 60 | // ANALYZE: 1: preprocessor, {0}, cpp-output |
| 61 | // ANALYZE: 2: analyzer, {1}, plist |
Daniel Dunbar | 1a172b8 | 2009-03-17 23:26:35 +0000 | [diff] [blame] | 62 | |
| 63 | // Precompiler |
Sebastian Pop | 9ec60df | 2012-01-20 22:01:23 +0000 | [diff] [blame] | 64 | // RUN: %clang -target i386-unknown-unknown -ccc-print-phases -x c-header %s 2>&1 | FileCheck -check-prefix=PCH %s |
Sebastian Redl | a98c034 | 2009-10-26 18:07:30 +0000 | [diff] [blame] | 65 | // PCH: 0: input, "{{.*}}phases.c", c-header |
| 66 | // PCH: 1: preprocessor, {0}, c-header-cpp-output |
| 67 | // PCH: 2: precompiler, {1}, precompiled-header |
Daniel Dunbar | 1a172b8 | 2009-03-17 23:26:35 +0000 | [diff] [blame] | 68 | |
Daniel Dunbar | e33bea4 | 2009-03-20 23:39:23 +0000 | [diff] [blame] | 69 | // Darwin overrides the handling for .s |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 70 | // RUN: touch %t.s |
Sebastian Pop | 9ec60df | 2012-01-20 22:01:23 +0000 | [diff] [blame] | 71 | // RUN: %clang -target i386-unknown-unknown -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN1 %s |
Sebastian Redl | a98c034 | 2009-10-26 18:07:30 +0000 | [diff] [blame] | 72 | // DARWIN1: 0: input, "{{.*}}.s", assembler |
| 73 | // DARWIN1: 1: assembler, {0}, object |
Sebastian Pop | 9ec60df | 2012-01-20 22:01:23 +0000 | [diff] [blame] | 74 | // RUN: %clang -target i386-apple-darwin9 -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN2 %s |
Sebastian Redl | a98c034 | 2009-10-26 18:07:30 +0000 | [diff] [blame] | 75 | // DARWIN2: 0: input, "{{.*}}.s", assembler-with-cpp |
| 76 | // DARWIN2: 1: preprocessor, {0}, assembler |
| 77 | // DARWIN2: 2: assembler, {1}, object |
Daniel Dunbar | e33bea4 | 2009-03-20 23:39:23 +0000 | [diff] [blame] | 78 | |