1 // Check support for `!cond' operator as part of a `let' statement.
2 // RUN: llvm-tblgen %s | FileCheck %s
6 class C<bits<3> x, bits<4> y, bit z> {
9 let n{11} = !cond(y{3}: 1,
14 let n{10...9}= !cond(x{2}: y{3...2},
18 let n{8...6} = !cond(x{2}: 0b010, 1 : 0b110);
19 let n{5...4} = !cond(x{1}: y{3...2}, 1 : {0, 1});
20 let n{3...0} = !cond(x{0}: y{3...0}, 1 : {z, y{2}, y{1}, y{0}});
24 def C1 : C<{1, 0, 1}, {0, 1, 0, 1}, 0>;
25 def C2 : C<{0, 1, 0}, {1, 0, 1, 0}, 1>;
26 def C3 : C<{0, 0, 0}, {1, 0, 1, 0}, 0>;
27 def C4 : C<{0, 0, 0}, {0, 0, 0, 0}, 0>;
30 // CHECK-NEXT: bits<16> n = { ?, ?, ?, ?, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1 };
32 // CHECK-NEXT: bits<16> n = { ?, ?, ?, ?, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0 };
34 // CHECK-NEXT: bits<16> n = { ?, ?, ?, ?, 1, ?, ?, 1, 1, 0, 0, 1, 0, 0, 1, 0 };
36 // CHECK-NEXT: bits<16> n = { ?, ?, ?, ?, ?, ?, ?, 1, 1, 0, 0, 1, 0, 0, 0, 0 };