150
|
1 // RUN: llvm-tblgen %s | FileCheck %s
|
|
2 // XFAIL: vg_leak
|
|
3
|
|
4 // Check that !cond picks the first true value
|
|
5 // CHECK: class A
|
|
6 // CHECK-NEXT: string S = !cond(!eq(A:x, 10): "ten", !eq(A:x, 11): "eleven", !eq(A:x, 10): "TEN", !gt(A:x, 9): "MoreThanNine", 1: "unknown");
|
|
7 // CHECK: B1
|
|
8 // CHECK-NEXT: string S = "unknown"
|
|
9 // CHECK: B10
|
|
10 // CHECK-NEXT: string S = "ten";
|
|
11 // CHECK: def B11
|
|
12 // CHECK-NEXT: string S = "eleven";
|
|
13 // CHECK: def B12
|
|
14 // CHECK-NEXT: string S = "MoreThanNine";
|
|
15 // CHECK: def B9
|
|
16 // CHECK-NEXT: string S = "unknown"
|
|
17
|
|
18 class A<int x> {
|
|
19 string S = !cond(!eq(x,10) : "ten",
|
|
20 !eq(x,11) : "eleven",
|
|
21 !eq(x,10) : "TEN",
|
|
22 !gt(x,9) : "MoreThanNine",
|
|
23 !eq(1,1) : "unknown");
|
|
24 }
|
|
25 def B1 : A<1>;
|
|
26 def B9 : A<9>;
|
|
27 def B10 : A<10>;
|
|
28 def B11 : A<11>;
|
|
29 def B12 : A<12>;
|