Mikhail Glushenkov | d9a7316 | 2010-08-23 23:21:23 +0000 | [diff] [blame] | 1 | // Check that LanguageMap is processed properly. |
| 2 | // RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t |
| 3 | // RUN: FileCheck -input-file %t %s |
Michael J. Spencer | 06b7f58 | 2010-08-30 14:49:00 +0000 | [diff] [blame] | 4 | // RUN: %compile_cxx %t |
Mikhail Glushenkov | d9a7316 | 2010-08-23 23:21:23 +0000 | [diff] [blame] | 5 | // XFAIL: vg_leak |
| 6 | |
| 7 | include "llvm/CompilerDriver/Common.td" |
| 8 | |
| 9 | def OptList : OptionList<[ |
| 10 | (switch_option "dummy1", (help "none")) |
| 11 | ]>; |
| 12 | |
| 13 | def dummy_tool : Tool<[ |
| 14 | (command "dummy_cmd"), |
| 15 | (in_language "dummy_lang"), |
| 16 | (out_language "dummy_lang"), |
| 17 | (actions (case |
| 18 | (switch_on "dummy1"), (forward "dummy1"))) |
| 19 | ]>; |
| 20 | |
| 21 | def lang_map : LanguageMap<[ |
| 22 | // CHECK: langMap["dummy"] = "dummy_lang" |
| 23 | // CHECK: langMap["DUM"] = "dummy_lang" |
| 24 | (lang_to_suffixes "dummy_lang", ["dummy", "DUM"]), |
| 25 | // CHECK: langMap["DUM2"] = "dummy_lang_2" |
| 26 | (lang_to_suffixes "dummy_lang_2", "DUM2") |
| 27 | ]>; |
| 28 | |
| 29 | def DummyGraph : CompilationGraph<[(edge "root", "dummy_tool")]>; |