1 // RUN: llvm-tblgen -dump-json %s | %python %S/JSON-check.py %s
4 // CHECK: data['Simple']['!locs'] == ['JSON-locs.td:3']
6 multiclass Multiclass1 {
11 defm DefM1 : Multiclass1;
13 // CHECK: data['DefM1Instance1']['!locs'] == ['JSON-locs.td:7', 'JSON-locs.td:11']
14 // CHECK: data['DefM1Instance2']['!locs'] == ['JSON-locs.td:8', 'JSON-locs.td:11']
16 multiclass Multiclass2 {
21 defm DefM2 : Multiclass1, Multiclass2;
22 // CHECK: data['DefM2Instance1']['!locs'] == ['JSON-locs.td:7', 'JSON-locs.td:21']
23 // CHECK: data['DefM2Instance2']['!locs'] == ['JSON-locs.td:8', 'JSON-locs.td:21']
24 // CHECK: data['DefM2Instance3']['!locs'] == ['JSON-locs.td:17', 'JSON-locs.td:21']
25 // CHECK: data['DefM2Instance4']['!locs'] == ['JSON-locs.td:18', 'JSON-locs.td:21']
27 multiclass Multiclass3 {
28 defm InnerDefM : Multiclass1;
32 defm DefM3: Multiclass3;
33 // CHECK: data['DefM3InnerDefMInstance1']['!locs'] == ['JSON-locs.td:7', 'JSON-locs.td:28', 'JSON-locs.td:32']
34 // CHECK: data['DefM3InnerDefMInstance2']['!locs'] == ['JSON-locs.td:8', 'JSON-locs.td:28', 'JSON-locs.td:32']
35 // CHECK: data['DefM3Instance5']['!locs'] == ['JSON-locs.td:29', 'JSON-locs.td:32']
38 class DerivedClass : BaseClass {}
39 // Classes do not appear in the JSON, so do not get locations.
40 // CHECK: 'BaseClass' not in data
41 // CHECK: 'DerivedClass' not in data
43 def ClassInstance : DerivedClass {}
44 // CHECK: data['ClassInstance']['!locs'] == ['JSON-locs.td:43']