xref: /llvm-project/llvm/test/TableGen/paste-reserved.td (revision ae2cb4f4273f2f2039e5c720d741f1e18e81943d)
1// RUN: not llvm-tblgen -DERROR1 %s 2>&1 | FileCheck --check-prefix=ERROR1 %s
2// RUN: not llvm-tblgen -DERROR2 %s 2>&1 | FileCheck --check-prefix=ERROR2 %s
3
4defvar list1 = ["foo", "bar", "snork"];
5
6// Pasting a list with a reserved word should produce an error.
7
8#ifdef ERROR1
9def list_paste {
10  list<string> the_list = list1 # in;
11}
12// ERROR1: error: Unknown or reserved token when parsing a value
13#endif
14
15
16// Pasting an identifier with a reserved word should produce an error.
17
18#ifdef ERROR2
19def name_paste#in {
20}
21// ERROR2: error: Unknown or reserved token when parsing a value
22#endif
23