14 files changed:
// Check that hooks can be invoked from 'append_cmd'.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// 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"
// RUN: %compile_cxx -fexceptions -x c++ %t
include "llvm/CompilerDriver/Common.td"
// 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
// 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"
// 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))]>;
def OptList : OptionList<[(switch_option "Wall", (extern)),
(parameter_option "std", (extern)),
(prefix_list_option "L", (extern))]>;
// Check the fix for PR4159.
// http://llvm.org/bugs/show_bug.cgi?id=4159
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// 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"
// RUN: %compile_cxx -fexceptions -x c++ %t
include "llvm/CompilerDriver/Common.td"
(in_language "dummy"),
(out_language "dummy"),
(actions (case
(in_language "dummy"),
(out_language "dummy"),
(actions (case
+ // CHECK: vec.push_back("unique_name")
(not_empty "dummy"), (forward_as "dummy", "unique_name")))
]>;
(not_empty "dummy"), (forward_as "dummy", "unique_name")))
]>;
// 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
// 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"
// RUN: %compile_cxx -fexceptions -x c++ %t
include "llvm/CompilerDriver/Common.td"
def OptList : OptionList<[(parameter_option "a", (extern)),
(prefix_list_option "b", (extern))]>;
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
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"),
(not_empty "a"), (forward_transformed_value "a", "HookA"),
+ // CHECK: HookB(AutoGeneratedList_b
(not_empty "b"), (forward_transformed_value "b", "HookB")))
]>;
(not_empty "b"), (forward_transformed_value "b", "HookB")))
]>;
// 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
// 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"
// RUN: %compile_cxx -fexceptions -x c++ %t
include "llvm/CompilerDriver/Common.td"
(in_language "dummy"),
(out_language "dummy"),
(actions (case
(in_language "dummy"),
(out_language "dummy"),
(actions (case
+ // CHECK: vec.push_back(AutoGeneratedParameter_a)
(not_empty "a"), (forward_value "a"),
(not_empty "a"), (forward_value "a"),
+ // CHECK: std::copy(AutoGeneratedList_b.begin()
(not_empty "b"), (forward_value "b")))
]>;
(not_empty "b"), (forward_value "b")))
]>;
// Check that hooks with arguments work.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// 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"
// 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"),
def dummy_tool : Tool<[
(cmd_line "$CALL(Hook, 'Arg1', 'Arg2', 'Arg3 Arg3Cont')/path arg1 $ENV(VARIABLE)/2path arg2 $INFILE"),
(in_language "dummy"),
// Check that a hook can be given $INFILE as an argument.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// 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<[
// 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")
(cmd_line "$CALL(Hook, '$INFILE')/path $INFILE"),
(in_language "dummy"),
(out_language "dummy")
// Check that (init true/false) and (init "str") work.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// 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<[
// 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)),
(switch_option "dummy1", (help "none"), (init true)),
+// CHECK: cl::init("some-string")
(parameter_option "dummy2", (help "none"), (init "some-string"))
]>;
(parameter_option "dummy2", (help "none"), (init "some-string"))
]>;
// 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
// 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<[
// 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))]>;
(prefix_list_option "foo", (multi_val 2)),
(parameter_list_option "baz", (multi_val 2), (extern))]>;
// Check that tools without associated actions are accepted.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// 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"
// 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"),
def dummy_tool : Tool<[
(cmd_line "dummy_cmd $INFILE"),
(in_language "dummy"),
// 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
// 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<[
// 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)),
(prefix_list_option "foo", (one_or_more)),
(parameter_list_option "baz", (optional))]>;
def dummy_tool : Tool<[
(parameter_list_option "baz", (optional))]>;
def dummy_tool : Tool<[
// Test for the OptionPreprocessor and any*.
// 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"
// RUN: %compile_cxx -fexceptions -x c++ %t
include "llvm/CompilerDriver/Common.td"
]>;
def Preprocess : OptionPreprocessor<
]>;
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"])),
(and (switch_on ["foo", "bar"]), (any_empty ["foo_p", "bar_p"])),
(warning "W2"),
(and (switch_on ["foo", "bar"]), (any_empty ["foo_p", "bar_p"])),
(warning "W2"),
(and (empty ["foo_p", "bar_p"]), (any_not_empty ["baz_p"])),
(warning "W3"))
>;
(and (empty ["foo_p", "bar_p"]), (any_not_empty ["baz_p"])),
(warning "W3"))
>;
// Check that hooks can be invoked from 'output_suffix'.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// 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: *
// RUN: %compile_cxx -fexceptions -x c++ %t
// XFAIL: *
O.indent(Indent1) << "static const char* InputLanguages_[];\n\n";
O << "public:\n";
O.indent(Indent1) << "static const char* InputLanguages_[];\n\n";
O << "public:\n";