blob: 694847358f66c8ef096092e6caaeeeb24048aae5 [file] [log] [blame]
Nicolai Haehnlec1b25e62018-03-06 13:48:30 +00001// RUN: llvm-tblgen %s | FileCheck %s
Jeffrey Yasskin32989de2010-03-20 23:08:45 +00002// XFAIL: vg_leak
Nicolai Haehnlec1b25e62018-03-06 13:48:30 +00003
4// CHECK: --- Defs ---
5
6// Test that P and Q are not replaced by ?. TableGen's codegen emitter backend
7// relies on keeping variable references like this around to describe the
8// structure of instruction encodings.
9//
10// CHECK: def A {
11// CHECK: bits<8> Inst = { 1, 1, 1, 1, 1, 1, P, Q };
12// CHECK: bits<2> src = { ?, ? };
13// CHECK: bit P = ?;
14// CHECK: bit Q = ?;
15// CHECK: }
16
17def A {
18 bits<8> Inst;
19 bits<2> src;
20
21 bit P;
22 bit Q;
23
24 let Inst{7-2} = 0x3f;
25 let Inst{1} = P;
26 let Inst{0} = Q;
27
28 let P = src{1};
29 let Q = src{0};
30}
31
Bob Wilson2214dc02009-11-22 03:58:57 +000032class x {
33 field bits<32> A;
34}
35
36class y<bits<2> B> : x {
37 let A{21-20} = B;
38}
39
40def z : y<{0,?}>;