Home | History | Annotate | Download | only in Driver
      1 // Basic compilation for various types of files.
      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>&1 | FileCheck -check-prefix=BASIC %s
      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
     25 
     26 // Universal linked image.
     27 // RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=ULI %s
     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
     36 
     37 // Universal object file.
     38 // RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x c %s -arch ppc -arch i386 2>&1 | FileCheck -check-prefix=UOF %s
     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
     46 
     47 // Arch defaulting
     48 // RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH1 %s
     49 // ARCH1: 2: bind-arch, "i386", {1}, object
     50 // RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s -m32 -m64 2>&1 | FileCheck -check-prefix=ARCH2 %s
     51 // ARCH2: 2: bind-arch, "x86_64", {1}, object
     52 // RUN: %clang -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH3 %s
     53 // ARCH3: 2: bind-arch, "x86_64", {1}, object
     54 // RUN: %clang -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s -m64 -m32 2>&1 | FileCheck -check-prefix=ARCH4 %s
     55 // ARCH4: 2: bind-arch, "i386", {1}, object
     56 
     57 // Analyzer
     58 // RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases --analyze %s 2>&1 | FileCheck -check-prefix=ANALYZE %s
     59 // ANALYZE: 0: input, "{{.*}}phases.c", c
     60 // ANALYZE: 1: preprocessor, {0}, cpp-output
     61 // ANALYZE: 2: analyzer, {1}, plist
     62 
     63 // Precompiler
     64 // RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -x c-header %s 2>&1 | FileCheck -check-prefix=PCH %s
     65 // PCH: 0: input, "{{.*}}phases.c", c-header
     66 // PCH: 1: preprocessor, {0}, c-header-cpp-output
     67 // PCH: 2: precompiler, {1}, precompiled-header
     68 
     69 // Darwin overrides the handling for .s
     70 // RUN: touch %t.s
     71 // RUN: %clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN1 %s
     72 // DARWIN1: 0: input, "{{.*}}.s", assembler
     73 // DARWIN1: 1: assembler, {0}, object
     74 // RUN: %clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN2 %s
     75 // DARWIN2: 0: input, "{{.*}}.s", assembler-with-cpp
     76 // DARWIN2: 1: preprocessor, {0}, assembler
     77 // DARWIN2: 2: assembler, {1}, object
     78 
     79