brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 4e46445 Raw
37 lines · plain
1// Check support for `!cond' operator as part of a `let' statement.2// RUN: llvm-tblgen %s | FileCheck %s3// XFAIL: vg_leak4 5 6class C<bits<3> x, bits<4> y, bit z> {7  bits<16> n;8 9  let n{11}  = !cond(y{3}: 1,10                     y{2}: x{0},11                     y{1}: x{1},12                     y{0}: x{2},13                     {1} :?);14  let n{10...9}= !cond(x{2}: y{3...2},15                       x{1}: y{2...1},16                       x{1}: y{1...0},17                       {1} : ?);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}});21}22 23 24def C1 : C<{1, 0, 1}, {0, 1, 0, 1}, 0>;25def C2 : C<{0, 1, 0}, {1, 0, 1, 0}, 1>;26def C3 : C<{0, 0, 0}, {1, 0, 1, 0}, 0>;27def C4 : C<{0, 0, 0}, {0, 0, 0, 0}, 0>;28 29// CHECK: def C130// CHECK-NEXT: bits<16> n = { ?, ?, ?, ?, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1 };31// CHECK: def C232// CHECK-NEXT: bits<16> n = { ?, ?, ?, ?, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0 };33// CHECK: def C334// CHECK-NEXT: bits<16> n = { ?, ?, ?, ?, 1, ?, ?, 1, 1, 0, 0, 1, 0, 0, 1, 0 };35// CHECK: def C436// CHECK-NEXT: bits<16> n = { ?, ?, ?, ?, ?, ?, ?, 1, 1, 0, 0, 1, 0, 0, 0, 0 };37