diff options
Diffstat (limited to 'test/Driver')
-rw-r--r-- | test/Driver/analyze.c | 8 | ||||
-rw-r--r-- | test/Driver/ccc-add-args.c | 6 | ||||
-rw-r--r-- | test/Driver/hello.c | 4 | ||||
-rw-r--r-- | test/Driver/phases.c | 126 | ||||
-rw-r--r-- | test/Driver/qa_override.c | 12 | ||||
-rw-r--r-- | test/Driver/std.c | 12 |
6 files changed, 85 insertions, 83 deletions
diff --git a/test/Driver/analyze.c b/test/Driver/analyze.c index 5ca890f9ab48..03810688d1f7 100644 --- a/test/Driver/analyze.c +++ b/test/Driver/analyze.c @@ -2,8 +2,8 @@ // (at least for a few key ones). // RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 clang -ccc-host-triple i386-apple-darwin9 -### --analyze -o /dev/null %s -msse 2> %t.log && -// RUN: grep '"-analyze"' %t.log && -// RUN: grep '"--fmath-errno=0"' %t.log && -// RUN: grep '"-target-feature" "+sse"' %t.log && -// RUN: grep '"-mmacosx-version-min=10.5"' %t.log +// RUN: FileCheck --input-file=%t.log %s +// CHECK: "-analyze" +// CHECK: "-target-feature" "+sse" +// CHECK: "--fmath-errno=0" diff --git a/test/Driver/ccc-add-args.c b/test/Driver/ccc-add-args.c index b504b0b42933..21e4471c1276 100644 --- a/test/Driver/ccc-add-args.c +++ b/test/Driver/ccc-add-args.c @@ -1,3 +1,3 @@ -// RUN: env CCC_ADD_ARGS="-ccc-echo,-ccc-print-options,,-v" clang -### 2> %t && -// RUN: grep -F 'Option 0 - Name: "-v", Values: {}' %t && -// RUN: grep -F 'Option 1 - Name: "-###", Values: {}' %t +// RUN: env CCC_ADD_ARGS="-ccc-echo,-ccc-print-options,,-v" clang -### 2>&1 | FileCheck %s +// CHECK: Option 0 - Name: "-v", Values: {} +// CHECK: Option 1 - Name: "-###", Values: {} diff --git a/test/Driver/hello.c b/test/Driver/hello.c index 7dbe9c74f9c5..ead0d07b57ce 100644 --- a/test/Driver/hello.c +++ b/test/Driver/hello.c @@ -6,6 +6,10 @@ // RUN: %t > %t.out && // RUN: grep "I'm a little driver, short and stout." %t.out +// FIXME: We don't have a usable assembler on Windows, so we can't build real +// apps yet. +// XFAIL: win32 + #include <stdio.h> int main() { diff --git a/test/Driver/phases.c b/test/Driver/phases.c index 0967d33816fe..61f68c452835 100644 --- a/test/Driver/phases.c +++ b/test/Driver/phases.c @@ -1,79 +1,79 @@ // Basic compilation for various types of files. -// 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 && -// RUN: grep '0: input, ".*phases.c", c' %t && -// RUN: grep -F '1: preprocessor, {0}, cpp-output' %t && -// RUN: grep -F '2: compiler, {1}, assembler' %t && -// RUN: grep -F '3: assembler, {2}, object' %t && -// RUN: grep '4: input, ".*phases.c", objective-c' %t && -// RUN: grep -F '5: preprocessor, {4}, objective-c-cpp-output' %t && -// RUN: grep -F '6: compiler, {5}, assembler' %t && -// RUN: grep -F '7: assembler, {6}, object' %t && -// RUN: grep '8: input, ".*phases.c", c++' %t && -// RUN: grep -F '9: preprocessor, {8}, c++-cpp-output' %t && -// RUN: grep -F '10: compiler, {9}, assembler' %t && -// RUN: grep -F '11: assembler, {10}, object' %t && -// RUN: grep '12: input, ".*phases.c", assembler' %t && -// RUN: grep -F '13: assembler, {12}, object' %t && -// RUN: grep '14: input, ".*phases.c", assembler-with-cpp' %t && -// RUN: grep -F '15: preprocessor, {14}, assembler' %t && -// RUN: grep -F '16: assembler, {15}, object' %t && -// RUN: grep '17: input, ".*phases.c", c' %t && -// RUN: grep -F '18: preprocessor, {17}, cpp-output' %t && -// RUN: grep -F '19: compiler, {18}, assembler' %t && -// RUN: grep -F '20: assembler, {19}, object' %t && -// RUN: grep -F '21: linker, {3, 7, 11, 13, 16, 20}, image' %t && +// 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 && +// BASIC: 0: input, "{{.*}}phases.c", c +// BASIC: 1: preprocessor, {0}, cpp-output +// BASIC: 2: compiler, {1}, assembler +// BASIC: 3: assembler, {2}, object +// BASIC: 4: input, "{{.*}}phases.c", objective-c +// BASIC: 5: preprocessor, {4}, objective-c-cpp-output +// BASIC: 6: compiler, {5}, assembler +// BASIC: 7: assembler, {6}, object +// BASIC: 8: input, "{{.*}}phases.c", c++ +// BASIC: 9: preprocessor, {8}, c++-cpp-output +// BASIC: 10: compiler, {9}, assembler +// BASIC: 11: assembler, {10}, object +// BASIC: 12: input, "{{.*}}phases.c", assembler +// BASIC: 13: assembler, {12}, object +// BASIC: 14: input, "{{.*}}phases.c", assembler-with-cpp +// BASIC: 15: preprocessor, {14}, assembler +// BASIC: 16: assembler, {15}, object +// BASIC: 17: input, "{{.*}}phases.c", c +// BASIC: 18: preprocessor, {17}, cpp-output +// BASIC: 19: compiler, {18}, assembler +// BASIC: 20: assembler, {19}, object +// BASIC: 21: linker, {3, 7, 11, 13, 16, 20}, image // Universal linked image. -// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -x c %s -arch ppc -arch i386 2> %t && -// RUN: grep '0: input, ".*phases.c", c' %t && -// RUN: grep -F '1: preprocessor, {0}, cpp-output' %t && -// RUN: grep -F '2: compiler, {1}, assembler' %t && -// RUN: grep -F '3: assembler, {2}, object' %t && -// RUN: grep -F '4: linker, {3}, image' %t && -// RUN: grep -F '5: bind-arch, "ppc", {4}, image' %t && -// RUN: grep -F '6: bind-arch, "i386", {4}, image' %t && -// RUN: grep -F '7: lipo, {5, 6}, image' %t && +// 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 && +// ULI: 0: input, "{{.*}}phases.c", c +// ULI: 1: preprocessor, {0}, cpp-output +// ULI: 2: compiler, {1}, assembler +// ULI: 3: assembler, {2}, object +// ULI: 4: linker, {3}, image +// ULI: 5: bind-arch, "ppc", {4}, image +// ULI: 6: bind-arch, "i386", {4}, image +// ULI: 7: lipo, {5, 6}, image // Universal object file. -// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x c %s -arch ppc -arch i386 2> %t && -// RUN: grep '0: input, ".*phases.c", c' %t && -// RUN: grep -F '1: preprocessor, {0}, cpp-output' %t && -// RUN: grep -F '2: compiler, {1}, assembler' %t && -// RUN: grep -F '3: assembler, {2}, object' %t && -// RUN: grep -F '4: bind-arch, "ppc", {3}, object' %t && -// RUN: grep -F '5: bind-arch, "i386", {3}, object' %t && -// RUN: grep -F '6: lipo, {4, 5}, object' %t && +// 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 && +// UOF: 0: input, "{{.*}}phases.c", c +// UOF: 1: preprocessor, {0}, cpp-output +// UOF: 2: compiler, {1}, assembler +// UOF: 3: assembler, {2}, object +// UOF: 4: bind-arch, "ppc", {3}, object +// UOF: 5: bind-arch, "i386", {3}, object +// UOF: 6: lipo, {4, 5}, object // Arch defaulting -// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s 2> %t && -// RUN: grep -F '2: bind-arch, "i386", {1}, object' %t && -// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s -m32 -m64 2> %t && -// RUN: grep -F '2: bind-arch, "x86_64", {1}, object' %t && -// RUN: clang -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s 2> %t && -// RUN: grep -F '2: bind-arch, "x86_64", {1}, object' %t && -// RUN: clang -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s -m64 -m32 2> %t && -// RUN: grep -F '2: bind-arch, "i386", {1}, object' %t && +// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH1 %s && +// ARCH1: 2: bind-arch, "i386", {1}, object +// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c -x assembler %s -m32 -m64 2>&1 | FileCheck -check-prefix=ARCH2 %s && +// ARCH2: 2: bind-arch, "x86_64", {1}, object +// RUN: clang -ccc-host-triple x86_64-apple-darwin9 -ccc-print-phases -c -x assembler %s 2>&1 | FileCheck -check-prefix=ARCH3 %s && +// ARCH3: 2: bind-arch, "x86_64", {1}, object +// 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 && +// ARCH4: 2: bind-arch, "i386", {1}, object // Analyzer -// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases --analyze %s 2> %t && -// RUN: grep '0: input, ".*phases.c", c' %t && -// RUN: grep -F '1: preprocessor, {0}, cpp-output' %t && -// RUN: grep -F '2: analyzer, {1}, plist' %t && +// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases --analyze %s 2>&1 | FileCheck -check-prefix=ANALYZE %s && +// ANALYZE: 0: input, "{{.*}}phases.c", c +// ANALYZE: 1: preprocessor, {0}, cpp-output +// ANALYZE: 2: analyzer, {1}, plist // Precompiler -// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -x c-header %s 2> %t && -// RUN: grep '0: input, ".*phases.c", c-header' %t && -// RUN: grep -F '1: preprocessor, {0}, c-header-cpp-output' %t && -// RUN: grep -F '2: precompiler, {1}, precompiled-header' %t && +// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -x c-header %s 2>&1 | FileCheck -check-prefix=PCH %s && +// PCH: 0: input, "{{.*}}phases.c", c-header +// PCH: 1: preprocessor, {0}, c-header-cpp-output +// PCH: 2: precompiler, {1}, precompiled-header // Darwin overrides the handling for .s // RUN: touch %t.s && -// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -c %t.s 2> %t && -// RUN: grep '0: input, ".*\.s", assembler' %t && -// RUN: grep -F '1: assembler, {0}, object' %t && -// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c %t.s 2> %t && -// RUN: grep '0: input, ".*\.s", assembler-with-cpp' %t && -// RUN: grep -F '1: preprocessor, {0}, assembler' %t && -// RUN: grep -F '2: assembler, {1}, object' %t && +// RUN: clang -ccc-host-triple i386-unknown-unknown -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN1 %s && +// DARWIN1: 0: input, "{{.*}}.s", assembler +// DARWIN1: 1: assembler, {0}, object +// RUN: clang -ccc-host-triple i386-apple-darwin9 -ccc-print-phases -c %t.s 2>&1 | FileCheck -check-prefix=DARWIN2 %s && +// DARWIN2: 0: input, "{{.*}}.s", assembler-with-cpp +// DARWIN2: 1: preprocessor, {0}, assembler +// DARWIN2: 2: assembler, {1}, object // RUN: true diff --git a/test/Driver/qa_override.c b/test/Driver/qa_override.c index 46e150c74fdc..6f72078f12af 100644 --- a/test/Driver/qa_override.c +++ b/test/Driver/qa_override.c @@ -1,7 +1,5 @@ -// RUN: env QA_OVERRIDE_GCC3_OPTIONS="#+-Os +-Oz +-O +-O3 +-Oignore +a +b +c xb Xa Omagic ^-ccc-print-options " clang x -O2 b -O3 2> %t && -// RUN: grep '### ' %t | count 0 && -// RUN: grep -F 'Option 0 - Name: "<input>", Values: {"x"}' %t && -// RUN: grep -F 'Option 1 - Name: "-O", Values: {"ignore"}' %t && -// RUN: grep -F 'Option 2 - Name: "-O", Values: {"magic"}' %t && -// RUN: true - +// RUN: env QA_OVERRIDE_GCC3_OPTIONS="#+-Os +-Oz +-O +-O3 +-Oignore +a +b +c xb Xa Omagic ^-ccc-print-options " clang x -O2 b -O3 2>&1 | FileCheck %s +// CHECK-NOT: ### +// CHECK: Option 0 - Name: "<input>", Values: {"x"} +// CHECK-NEXT: Option 1 - Name: "-O", Values: {"ignore"} +// CHECK-NEXT: Option 2 - Name: "-O", Values: {"magic"} diff --git a/test/Driver/std.c b/test/Driver/std.c index ef6d8f197754..04113d5af134 100644 --- a/test/Driver/std.c +++ b/test/Driver/std.c @@ -1,8 +1,8 @@ -// RUN: clang -std=c99 -trigraphs -std=gnu99 %s -E -o %t && -// RUN: grep '??(??)' %t && -// RUN: clang -ansi %s -E -o %t && -// RUN: grep -F '[]' %t && -// RUN: clang -std=gnu99 -trigraphs %s -E -o %t && -// RUN: grep -F '[]' %t +// RUN: clang -std=c99 -trigraphs -std=gnu99 %s -E -o - | FileCheck -check-prefix=OVERRIDE %s && +// OVERRIDE: ??(??) +// RUN: clang -ansi %s -E -o - | FileCheck -check-prefix=ANSI %s && +// ANSI: [] +// RUN: clang -std=gnu99 -trigraphs %s -E -o - | FileCheck -check-prefix=EXPLICIT %s +// EXPLICIT: [] ??(??) |