diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2009-12-15 03:04:52 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2009-12-15 03:04:52 +0000 |
commit | e4ac23a0ffbf3ad6eb94fce4e0fb2b934b84cbe4 (patch) | |
tree | 6f53530e91bde17f4c0d73fbc6b249d15c273847 /test/LLVMC | |
parent | b5fab402d02671f92ea7fc6166ba80e00d6a8388 (diff) | |
download | external_llvm-e4ac23a0ffbf3ad6eb94fce4e0fb2b934b84cbe4.zip external_llvm-e4ac23a0ffbf3ad6eb94fce4e0fb2b934b84cbe4.tar.gz external_llvm-e4ac23a0ffbf3ad6eb94fce4e0fb2b934b84cbe4.tar.bz2 |
Validate the generated C++ code in llvmc tests.
Checks that the code generated by 'tblgen --emit-llvmc' can be actually
compiled. Also fixes two bugs found in this way:
- forward_transformed_value didn't work with non-list arguments
- cl::ZeroOrOne is now called cl::Optional
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91404 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/LLVMC')
-rw-r--r-- | test/LLVMC/EmptyCompilationGraph.td | 3 | ||||
-rw-r--r-- | test/LLVMC/EnvParentheses.td | 1 | ||||
-rw-r--r-- | test/LLVMC/ExternOptions.td | 1 | ||||
-rw-r--r-- | test/LLVMC/ForwardAs.td | 1 | ||||
-rw-r--r-- | test/LLVMC/ForwardTransformedValue.td | 5 | ||||
-rw-r--r-- | test/LLVMC/ForwardValue.td | 1 | ||||
-rw-r--r-- | test/LLVMC/HookWithArguments.td | 1 | ||||
-rw-r--r-- | test/LLVMC/HookWithInFile.td | 1 | ||||
-rw-r--r-- | test/LLVMC/Init.td | 1 | ||||
-rw-r--r-- | test/LLVMC/MultiValuedOption.td | 1 | ||||
-rw-r--r-- | test/LLVMC/MultipleCompilationGraphs.td | 3 | ||||
-rw-r--r-- | test/LLVMC/NoActions.td | 4 | ||||
-rw-r--r-- | test/LLVMC/NoCompilationGraph.td | 3 | ||||
-rw-r--r-- | test/LLVMC/OneOrMore.td | 5 | ||||
-rw-r--r-- | test/LLVMC/OptionPreprocessor.td | 1 | ||||
-rw-r--r-- | test/LLVMC/TestWarnings.td | 2 |
16 files changed, 25 insertions, 9 deletions
diff --git a/test/LLVMC/EmptyCompilationGraph.td b/test/LLVMC/EmptyCompilationGraph.td index b30f84c..934905b 100644 --- a/test/LLVMC/EmptyCompilationGraph.td +++ b/test/LLVMC/EmptyCompilationGraph.td @@ -1,5 +1,6 @@ // Check that the compilation graph can be empty. -// RUN: tblgen -I %p/../../include --gen-llvmc %s +// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t +// RUN: %compile_cxx -fexceptions -x c++ %t include "llvm/CompilerDriver/Common.td" diff --git a/test/LLVMC/EnvParentheses.td b/test/LLVMC/EnvParentheses.td index 694468f..77aab95 100644 --- a/test/LLVMC/EnvParentheses.td +++ b/test/LLVMC/EnvParentheses.td @@ -2,6 +2,7 @@ // http://llvm.org/bugs/show_bug.cgi?id=4157 // RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t // RUN: not grep {)));} %t +// RUN: %compile_cxx -fexceptions -x c++ %t include "llvm/CompilerDriver/Common.td" diff --git a/test/LLVMC/ExternOptions.td b/test/LLVMC/ExternOptions.td index 5c69af7..4694b10 100644 --- a/test/LLVMC/ExternOptions.td +++ b/test/LLVMC/ExternOptions.td @@ -2,6 +2,7 @@ // 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: %compile_cxx -fexceptions -x c++ %t include "llvm/CompilerDriver/Common.td" diff --git a/test/LLVMC/ForwardAs.td b/test/LLVMC/ForwardAs.td index 51bd494..54fc050 100644 --- a/test/LLVMC/ForwardAs.td +++ b/test/LLVMC/ForwardAs.td @@ -2,6 +2,7 @@ // 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: %compile_cxx -fexceptions -x c++ %t include "llvm/CompilerDriver/Common.td" diff --git a/test/LLVMC/ForwardTransformedValue.td b/test/LLVMC/ForwardTransformedValue.td index 478d126..0cda1bf 100644 --- a/test/LLVMC/ForwardTransformedValue.td +++ b/test/LLVMC/ForwardTransformedValue.td @@ -1,8 +1,9 @@ // 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 -// RUN: grep HookB %t +// RUN: grep HookA %t | count 2 +// RUN: grep HookB %t | count 2 +// RUN: %compile_cxx -fexceptions -x c++ %t include "llvm/CompilerDriver/Common.td" diff --git a/test/LLVMC/ForwardValue.td b/test/LLVMC/ForwardValue.td index aebb198..29f61a4 100644 --- a/test/LLVMC/ForwardValue.td +++ b/test/LLVMC/ForwardValue.td @@ -3,6 +3,7 @@ // 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: %compile_cxx -fexceptions -x c++ %t include "llvm/CompilerDriver/Common.td" diff --git a/test/LLVMC/HookWithArguments.td b/test/LLVMC/HookWithArguments.td index 3bdb3ee..909dc8b 100644 --- a/test/LLVMC/HookWithArguments.td +++ b/test/LLVMC/HookWithArguments.td @@ -4,6 +4,7 @@ // RUN: grep "/path" %t | count 1 // RUN: grep "VARIABLE" %t | count 1 // RUN: grep "/2path" %t | count 1 +// RUN: %compile_cxx -fexceptions -x c++ %t include "llvm/CompilerDriver/Common.td" diff --git a/test/LLVMC/HookWithInFile.td b/test/LLVMC/HookWithInFile.td index a2cc4d8..7fb3df1 100644 --- a/test/LLVMC/HookWithInFile.td +++ b/test/LLVMC/HookWithInFile.td @@ -1,6 +1,7 @@ // 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: %compile_cxx -fexceptions -x c++ %t include "llvm/CompilerDriver/Common.td" diff --git a/test/LLVMC/Init.td b/test/LLVMC/Init.td index d9a4fc1..3d68d05 100644 --- a/test/LLVMC/Init.td +++ b/test/LLVMC/Init.td @@ -2,6 +2,7 @@ // 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: %compile_cxx -fexceptions -x c++ %t include "llvm/CompilerDriver/Common.td" diff --git a/test/LLVMC/MultiValuedOption.td b/test/LLVMC/MultiValuedOption.td index bd1e033..108eb86 100644 --- a/test/LLVMC/MultiValuedOption.td +++ b/test/LLVMC/MultiValuedOption.td @@ -2,6 +2,7 @@ // 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: %compile_cxx -fexceptions -x c++ %t include "llvm/CompilerDriver/Common.td" diff --git a/test/LLVMC/MultipleCompilationGraphs.td b/test/LLVMC/MultipleCompilationGraphs.td index 64dbc9b..9702248 100644 --- a/test/LLVMC/MultipleCompilationGraphs.td +++ b/test/LLVMC/MultipleCompilationGraphs.td @@ -1,5 +1,6 @@ // Check that multiple compilation graphs are allowed. -// RUN: tblgen -I %p/../../include --gen-llvmc %s +// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t +// RUN: %compile_cxx -fexceptions -x c++ %t include "llvm/CompilerDriver/Common.td" diff --git a/test/LLVMC/NoActions.td b/test/LLVMC/NoActions.td index 2a4a749..7b8e721 100644 --- a/test/LLVMC/NoActions.td +++ b/test/LLVMC/NoActions.td @@ -1,5 +1,7 @@ // Check that tools without associated actions are accepted. -// RUN: tblgen -I %p/../../include --gen-llvmc %s | grep dummy_tool +// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t +// RUN: grep dummy_tool %t +// RUN: %compile_cxx -fexceptions -x c++ %t include "llvm/CompilerDriver/Common.td" diff --git a/test/LLVMC/NoCompilationGraph.td b/test/LLVMC/NoCompilationGraph.td index 2eea3e9..96c1f17 100644 --- a/test/LLVMC/NoCompilationGraph.td +++ b/test/LLVMC/NoCompilationGraph.td @@ -1,4 +1,5 @@ // Check that the compilation graph is not required. -// RUN: tblgen -I %p/../../include --gen-llvmc %s +// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t +// RUN: %compile_cxx -fexceptions -x c++ %t include "llvm/CompilerDriver/Common.td" diff --git a/test/LLVMC/OneOrMore.td b/test/LLVMC/OneOrMore.td index 38b7eb7..08be7cf 100644 --- a/test/LLVMC/OneOrMore.td +++ b/test/LLVMC/OneOrMore.td @@ -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::ZeroOrOne %t | count 1 +// RUN: grep cl::Optional %t | count 1 // RUN: grep cl::OneOrMore %t | count 1 +// RUN: %compile_cxx -fexceptions -x c++ %t include "llvm/CompilerDriver/Common.td" def OptList : OptionList<[ (prefix_list_option "foo", (one_or_more)), - (parameter_list_option "baz", (zero_or_one))]>; + (parameter_list_option "baz", (optional))]>; def dummy_tool : Tool<[ (cmd_line "dummy_cmd $INFILE"), diff --git a/test/LLVMC/OptionPreprocessor.td b/test/LLVMC/OptionPreprocessor.td index 5b9f435..2f5e68b 100644 --- a/test/LLVMC/OptionPreprocessor.td +++ b/test/LLVMC/OptionPreprocessor.td @@ -3,6 +3,7 @@ // RUN: grep W1 %t // RUN: grep W2 %t // RUN: grep W3 %t +// RUN: %compile_cxx -fexceptions -x c++ %t include "llvm/CompilerDriver/Common.td" diff --git a/test/LLVMC/TestWarnings.td b/test/LLVMC/TestWarnings.td index 1a4064e..9523e24 100644 --- a/test/LLVMC/TestWarnings.td +++ b/test/LLVMC/TestWarnings.td @@ -1,4 +1,4 @@ -// Check that the compiler warns about unused options. +// Check that warnings about unused options are really emitted. // This should fail because the output is printed on stderr. // RUN: ignore tblgen -I %p/../../include --gen-llvmc %s |& grep "option '-Wall' has no effect!" |