summaryrefslogtreecommitdiffstats
path: root/llvm/test/TableGen/cond-inheritance.td
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/TableGen/cond-inheritance.td')
-rw-r--r--llvm/test/TableGen/cond-inheritance.td22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/TableGen/cond-inheritance.td b/llvm/test/TableGen/cond-inheritance.td
new file mode 100644
index 00000000000..4b4abdf72f3
--- /dev/null
+++ b/llvm/test/TableGen/cond-inheritance.td
@@ -0,0 +1,22 @@
+// Make sure !cond gets propagated across multiple layers of inheritance.
+// RUN: llvm-tblgen %s | FileCheck %s
+// XFAIL: vg_leak
+
+class getInt<int c> {
+ int ret = !cond(c: 0, 1 : 1);
+}
+
+class I1<int c> {
+ int i = getInt<c>.ret;
+}
+
+class I2<int c> : I1<c>;
+
+def DI1: I1<1>;
+// CHECK: def DI1 { // I1
+// CHECK-NEXT: int i = 0;
+
+// CHECK: def DI2 { // I1 I2
+// CHECK-NEXT: int i = 0;
+def DI2: I2<1>;
+
OpenPOWER on IntegriCloud