Convert llvmc tests to FileCheck.
authorMikhail Glushenkov <foldr@codedgers.com>
Tue, 15 Dec 2009 07:21:14 +0000 (07:21 +0000)
committerMikhail Glushenkov <foldr@codedgers.com>
Tue, 15 Dec 2009 07:21:14 +0000 (07:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91420 91177308-0d34-0410-b5e6-96231b3b80d8

14 files changed:
test/LLVMC/AppendCmdHook.td
test/LLVMC/ExternOptions.td
test/LLVMC/ForwardAs.td
test/LLVMC/ForwardTransformedValue.td
test/LLVMC/ForwardValue.td
test/LLVMC/HookWithArguments.td
test/LLVMC/HookWithInFile.td
test/LLVMC/Init.td
test/LLVMC/MultiValuedOption.td
test/LLVMC/NoActions.td
test/LLVMC/OneOrMore.td
test/LLVMC/OptionPreprocessor.td
test/LLVMC/OutputSuffixHook.td
utils/TableGen/LLVMCConfigurationEmitter.cpp

index 888d6869999a696f79656122c79c9193317efb3c..4a9d39121a4af38dd946185499b3a072d1101a00 100644 (file)
@@ -1,6 +1,6 @@
 // Check that hooks can be invoked from 'append_cmd'.
 // RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
-// RUN: FileCheck -input-file=%t %s
+// RUN: FileCheck -input-file %t %s
 // RUN: %compile_cxx -fexceptions -x c++ %t
 
 include "llvm/CompilerDriver/Common.td"
index 4694b106e2b4263e247aef1caf21ccf16be546fc..a05f2ca15b6f125b2ef567f57a67e357edf32a5e 100644 (file)
@@ -1,11 +1,13 @@
 // Check that extern options work.
 // The dummy tool and graph are required to silence warnings.
 // RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
-// RUN: grep {extern .* AutoGeneratedSwitch_Wall} %t
+// RUN: FileCheck -input-file %t %s
 // RUN: %compile_cxx -fexceptions -x c++ %t
 
 include "llvm/CompilerDriver/Common.td"
 
+// CHECK: extern cl::opt<bool> AutoGeneratedSwitch_Wall
+
 def OptList : OptionList<[(switch_option "Wall", (extern)),
                           (parameter_option "std", (extern)),
                           (prefix_list_option "L", (extern))]>;
index 54fc050a98156b4faa0b11c279e950d8984a443b..ce6fbb06ef51f0b01386a87bcd9ffb7868efda80 100644 (file)
@@ -1,7 +1,7 @@
 // Check the fix for PR4159.
 // http://llvm.org/bugs/show_bug.cgi?id=4159
 // RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
-// RUN: grep unique_name %t
+// RUN: FileCheck -input-file %t %s
 // RUN: %compile_cxx -fexceptions -x c++ %t
 
 include "llvm/CompilerDriver/Common.td"
@@ -13,6 +13,7 @@ def dummy_tool : Tool<[
 (in_language "dummy"),
 (out_language "dummy"),
 (actions (case
+         // CHECK: vec.push_back("unique_name")
          (not_empty "dummy"), (forward_as "dummy", "unique_name")))
 ]>;
 
index 0cda1bf1a5bef50faf8be74c034dbf20bfe48c07..e26345362c0f3f4e0768bdba3a1322240aab6b84 100644 (file)
@@ -1,8 +1,7 @@
 // Check that forward_transformed_value works.
 // The dummy tool and graph are required to silence warnings.
 // RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
-// RUN: grep HookA %t | count 2
-// RUN: grep HookB %t | count 2
+// RUN: FileCheck -input-file %t %s
 // RUN: %compile_cxx -fexceptions -x c++ %t
 
 include "llvm/CompilerDriver/Common.td"
@@ -10,12 +9,17 @@ include "llvm/CompilerDriver/Common.td"
 def OptList : OptionList<[(parameter_option "a", (extern)),
                           (prefix_list_option "b", (extern))]>;
 
+// CHECK: std::string HookA
+// CHECK: std::string HookB
+
 def dummy_tool : Tool<[
 (cmd_line "dummy_cmd $INFILE"),
 (in_language "dummy"),
 (out_language "dummy"),
 (actions (case
+         // CHECK: HookA(AutoGeneratedParameter_a
          (not_empty "a"), (forward_transformed_value "a", "HookA"),
+         // CHECK: HookB(AutoGeneratedList_b
          (not_empty "b"), (forward_transformed_value "b", "HookB")))
 ]>;
 
index 29f61a4c0cfc5d4030a04971dc99bacf79c83d66..31e395e6d0bcfc6c7abbe5001d2fb4ea9641a411 100644 (file)
@@ -1,8 +1,7 @@
 // Check that forward_value works.
 // The dummy tool and graph are required to silence warnings.
 // RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
-// RUN: grep {vec.push_back\(AutoGeneratedParameter_a\)} %t
-// RUN: grep {std::copy\(AutoGeneratedList_b.begin\(\)} %t
+// RUN: FileCheck -input-file %t %s
 // RUN: %compile_cxx -fexceptions -x c++ %t
 
 include "llvm/CompilerDriver/Common.td"
@@ -15,7 +14,9 @@ def dummy_tool : Tool<[
 (in_language "dummy"),
 (out_language "dummy"),
 (actions (case
+         // CHECK: vec.push_back(AutoGeneratedParameter_a)
          (not_empty "a"), (forward_value "a"),
+         // CHECK: std::copy(AutoGeneratedList_b.begin()
          (not_empty "b"), (forward_value "b")))
 ]>;
 
index 909dc8bf9b472fceeedfda3c717c535e5302803d..ba0bbe10d37a7c04f08cdc20c11f7fdcc88cc440 100644 (file)
@@ -1,13 +1,15 @@
 // Check that hooks with arguments work.
 // RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
-// RUN: grep {Hook(const char\\* Arg0, const char\\* Arg1, const char\\* Arg2);} %t | count 1
-// RUN: grep "/path" %t | count 1
-// RUN: grep "VARIABLE" %t | count 1
-// RUN: grep "/2path" %t | count 1
+// RUN: FileCheck -input-file %t %s
 // RUN: %compile_cxx -fexceptions -x c++ %t
 
 include "llvm/CompilerDriver/Common.td"
 
+// CHECK: Hook(const char* Arg0, const char* Arg1, const char* Arg2);
+// CHECK: std::getenv("VARIABLE")
+// CHECK: "/2path"
+// CHECK: "/path"
+
 def dummy_tool : Tool<[
 (cmd_line "$CALL(Hook, 'Arg1',   'Arg2', 'Arg3 Arg3Cont')/path arg1 $ENV(VARIABLE)/2path arg2 $INFILE"),
 (in_language "dummy"),
index 7fb3df1c9a66b2af2ce610dd59be62676a9d0b64..e15e43cdf040bd6c0688fdcb514113c7a3d447e4 100644 (file)
@@ -1,11 +1,12 @@
 // Check that a hook can be given $INFILE as an argument.
 // RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
-// RUN: grep Hook\\(inFile.c_str\\(\\)\\) %t | count 1
+// RUN: FileCheck -input-file %t %s
 // RUN: %compile_cxx -fexceptions -x c++ %t
 
 include "llvm/CompilerDriver/Common.td"
 
 def dummy_tool : Tool<[
+// CHECK: Hook(inFile.c_str())
 (cmd_line "$CALL(Hook, '$INFILE')/path $INFILE"),
 (in_language "dummy"),
 (out_language "dummy")
index 3d68d050ee967795013eee63b054634d41dc0bf0..355d83ff95aef8427ffc65c5e4b42bf989799a1b 100644 (file)
@@ -1,13 +1,14 @@
 // Check that (init true/false) and (init "str") work.
 // RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
-// RUN: grep cl::init(\\"some-string\\") %t | count 1
-// RUN: grep cl::init(true) %t | count 1
+// RUN: FileCheck -input-file %t %s
 // RUN: %compile_cxx -fexceptions -x c++ %t
 
 include "llvm/CompilerDriver/Common.td"
 
 def OptList : OptionList<[
+// CHECK: cl::init(true)
 (switch_option "dummy1", (help "none"), (init true)),
+// CHECK: cl::init("some-string")
 (parameter_option "dummy2", (help "none"), (init "some-string"))
 ]>;
 
index 108eb86dbebd43c6b68b635ed3ca20a97ae9ceb6..8cb18782700c64f783c3cace3d8a7ec645c2009a 100644 (file)
@@ -1,12 +1,13 @@
 // Check that multivalued options work.
 // The dummy tool and graph are required to silence warnings.
 // RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
-// RUN: grep cl::multi_val(2) %t | count 1
+// RUN: FileCheck -input-file %t %s
 // RUN: %compile_cxx -fexceptions -x c++ %t
 
 include "llvm/CompilerDriver/Common.td"
 
 def OptList : OptionList<[
+    // CHECK: cl::multi_val(2)
     (prefix_list_option "foo", (multi_val 2)),
     (parameter_list_option "baz", (multi_val 2), (extern))]>;
 
index 7b8e721397a240a9e929f19cf03fc4978f29b85b..9c2d45a810f6bdfd8834f1edd59d637df4c45b20 100644 (file)
@@ -1,10 +1,11 @@
 // Check that tools without associated actions are accepted.
 // RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
-// RUN: grep dummy_tool %t
+// RUN: FileCheck -input-file %t %s
 // RUN: %compile_cxx -fexceptions -x c++ %t
 
 include "llvm/CompilerDriver/Common.td"
 
+// CHECK: class dummy_tool : public Tool {
 def dummy_tool : Tool<[
 (cmd_line "dummy_cmd $INFILE"),
 (in_language "dummy"),
index 08be7cfe8a7af1120a4f2608d985c5f4c7eec857..ddf7cd1143a98c9ace4718d0c5bd89025b8d6c76 100644 (file)
@@ -1,14 +1,15 @@
 // Check that (one_or_more) and (zero_or_one) properties work.
 // The dummy tool and graph are required to silence warnings.
 // RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
-// RUN: grep cl::Optional %t | count 1
-// RUN: grep cl::OneOrMore %t | count 1
+// RUN: FileCheck -input-file %t %s
 // RUN: %compile_cxx -fexceptions -x c++ %t
 
 include "llvm/CompilerDriver/Common.td"
 
 def OptList : OptionList<[
+    // CHECK: cl::OneOrMore
     (prefix_list_option "foo", (one_or_more)),
+    // CHECK: cl::Optional
     (parameter_list_option "baz", (optional))]>;
 
 def dummy_tool : Tool<[
index 2f5e68bfe51f1ad66b4c4959624de423facbec3f..5661db865d7cc8eca21de8fa687cf33791da57bd 100644 (file)
@@ -1,8 +1,6 @@
 // Test for the OptionPreprocessor and any*.
-// RUN: ignore tblgen -I %p/../../include --gen-llvmc %s -o %t
-// RUN: grep W1 %t
-// RUN: grep W2 %t
-// RUN: grep W3 %t
+// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
+// RUN: FileCheck -input-file %t %s
 // RUN: %compile_cxx -fexceptions -x c++ %t
 
 include "llvm/CompilerDriver/Common.td"
@@ -17,10 +15,14 @@ def OptList : OptionList<[
 ]>;
 
 def Preprocess : OptionPreprocessor<
-(case (and (switch_on "foo"), (any_switch_on ["bar", "baz"])),
+(case
+      // CHECK: W1
+      (and (switch_on "foo"), (any_switch_on ["bar", "baz"])),
            (warning "W1"),
+      // CHECK: W2
       (and (switch_on ["foo", "bar"]), (any_empty ["foo_p", "bar_p"])),
            (warning "W2"),
+      // CHECK: W3
       (and (empty ["foo_p", "bar_p"]), (any_not_empty ["baz_p"])),
            (warning "W3"))
 >;
index d1f9999b15ccd863019b810e62926f1734659aae..4ecad2360ba062baf9e5e6cc95c056e997c1c3f3 100644 (file)
@@ -1,6 +1,6 @@
 // Check that hooks can be invoked from 'output_suffix'.
 // RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
-// RUN: FileCheck -input-file=%t %s
+// RUN: FileCheck -input-file %t %s
 // RUN: %compile_cxx -fexceptions -x c++ %t
 // XFAIL: *
 
index 6217f5c1d34a8e85f00186af390a5268c4da4207..5be9ab71ef1b4d7196277118fe29d09d88f5c791 100644 (file)
@@ -2169,7 +2169,7 @@ void EmitToolClassDefinition (const ToolDescription& D,
   else
     O << "Tool";
 
-  O << "{\nprivate:\n";
+  O << " {\nprivate:\n";
   O.indent(Indent1) << "static const char* InputLanguages_[];\n\n";
 
   O << "public:\n";