Mercurial > hg > CbC > CbC_llvm
comparison llvm/test/TableGen/size.td @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | 1d019706d866 |
children |
comparison
equal
deleted
inserted
replaced
173:0572611fdcc8 | 207:2e18cbf3894f |
---|---|
1 // RUN: llvm-tblgen %s | FileCheck %s | 1 // RUN: llvm-tblgen %s | FileCheck %s |
2 // XFAIL: vg_leak | 2 // XFAIL: vg_leak |
3 | |
4 // Test !size of lists. | |
3 | 5 |
4 // CHECK: --- Defs --- | 6 // CHECK: --- Defs --- |
5 | 7 |
6 // CHECK: def A1 { | 8 // CHECK: def A1 { |
7 // CHECK: int Val = 0; | 9 // CHECK: int Val = 0; |
30 def A1 : A<[]>; | 32 def A1 : A<[]>; |
31 def A2 : A<[1, 1, 2]>; | 33 def A2 : A<[1, 1, 2]>; |
32 | 34 |
33 def B1 : B<[]>; | 35 def B1 : B<[]>; |
34 def B2 : B<["a", "b"]>; | 36 def B2 : B<["a", "b"]>; |
37 | |
38 // Test !size of DAGs. | |
39 | |
40 // CHECK: def D0 { | |
41 // CHECK: int Val = 0; | |
42 // CHECK: } | |
43 | |
44 // CHECK: def D1 { | |
45 // CHECK: int Val = 1; | |
46 // CHECK: } | |
47 | |
48 // CHECK: def D2 { | |
49 // CHECK: int Val = 2; | |
50 // CHECK: } | |
51 | |
52 // CHECK: def D3 { | |
53 // CHECK: int Val = 3; | |
54 // CHECK: } | |
55 | |
56 // CHECK: def D4 { | |
57 // CHECK: int Val = 4; | |
58 // CHECK: } | |
59 | |
60 class D<dag D> { | |
61 int Val = !size(D); | |
62 } | |
63 | |
64 def op; | |
65 | |
66 def D0 : D<(op)>; | |
67 def D1 : D<(op "string")>; | |
68 def D2 : D<(op "string", 42)>; | |
69 def D3 : D<(op "string", 42, (op "sub-dag"))>; | |
70 def D4 : D<(op "string", 42, (op "sub-dag"), D0.Val)>; | |
71 | |
72 // Test !size of strings. | |
73 | |
74 // CHECK: def S0 { | |
75 // CHECK: int Val = 0; | |
76 // CHECK: } | |
77 | |
78 // CHECK: def S1 { | |
79 // CHECK: int Val = 1; | |
80 // CHECK: } | |
81 | |
82 // CHECK: def S2 { | |
83 // CHECK: int Val = 2; | |
84 // CHECK: } | |
85 | |
86 // CHECK: def S3 { | |
87 // CHECK: int Val = 3; | |
88 // CHECK: } | |
89 | |
90 // CHECK: def S4 { | |
91 // CHECK: int Val = 29; | |
92 // CHECK: } | |
93 | |
94 class S<string S> { | |
95 int Val = !size(S); | |
96 } | |
97 | |
98 def S0 : S<"">; | |
99 def S1 : S<"a">; | |
100 def S2 : S<"ab">; | |
101 def S3 : S<"abc">; | |
102 def S4 : S<"This is the end of the world!">; | |
103 |