diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-10-26 18:07:30 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-10-26 18:07:30 +0000 |
commit | a98c0348f6bbc0d3c473f8d1e46d15493324f0e5 (patch) | |
tree | 34a6ea8f70e8c1c0ffc036ca28a88c8f59ec8f2d /test/Driver | |
parent | 09bdd599c1cf8f60ffba6f3838c8009a4e1decff (diff) | |
download | clang-a98c0348f6bbc0d3c473f8d1e46d15493324f0e5.tar.gz |
Convert some driver checks to FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85133 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Driver')
-rw-r--r-- | test/Driver/ccc-add-args.c | 6 | ||||
-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 |
4 files changed, 77 insertions, 79 deletions
diff --git a/test/Driver/ccc-add-args.c b/test/Driver/ccc-add-args.c index b504b0b429..21e4471c12 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/phases.c b/test/Driver/phases.c index 0967d33816..61f68c4528 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 46e150c74f..6f72078f12 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 ef6d8f1977..04113d5af1 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: [] ??(??) |