30 lines · plain
1// RUN: llvm-tblgen %s | FileCheck %s2// XFAIL: vg_leak3 4// Check that !cond picks the first true value5// CHECK: class A6// 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: B18// CHECK-NEXT: string S = "unknown"9// CHECK: B1010// CHECK-NEXT: string S = "ten";11// CHECK: def B1112// CHECK-NEXT: string S = "eleven";13// CHECK: def B1214// CHECK-NEXT: string S = "MoreThanNine";15// CHECK: def B916// CHECK-NEXT: string S = "unknown"17 18class 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}25def B1 : A<1>;26def B9 : A<9>;27def B10 : A<10>;28def B11 : A<11>;29def B12 : A<12>;30