summaryrefslogtreecommitdiff
path: root/test/TableGen
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-08-22 20:46:05 +0000
committerBill Wendling <isanbard@gmail.com>2013-08-22 20:46:05 +0000
commitb4be7f6b04c990d6bd969e7304d350de45c87f04 (patch)
treeb656cdc3a28824063e039346c1785237fbb66609 /test/TableGen
parent344cfb4db4b22f3330cbfc5ccb5e1149cd4e17e3 (diff)
FileCheckize some tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189060 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/TableGen')
-rw-r--r--test/TableGen/2006-09-18-LargeInt.td4
-rw-r--r--test/TableGen/DefmInherit.td8
-rw-r--r--test/TableGen/DefmInsideMultiClass.td5
-rw-r--r--test/TableGen/LazyChange.td4
-rw-r--r--test/TableGen/LetInsideMultiClasses.td7
-rw-r--r--test/TableGen/ListOfList.td5
-rw-r--r--test/TableGen/MultiClass.td6
-rw-r--r--test/TableGen/MultiClassDefName.td5
-rw-r--r--test/TableGen/MultiClassInherit.td33
-rw-r--r--test/TableGen/TargetInstrSpec.td9
-rw-r--r--test/TableGen/cast.td7
-rw-r--r--test/TableGen/foreach.td13
-rw-r--r--test/TableGen/lisp.td17
-rw-r--r--test/TableGen/strconcat.td4
-rw-r--r--test/TableGen/subst.td60
15 files changed, 162 insertions, 25 deletions
diff --git a/test/TableGen/2006-09-18-LargeInt.td b/test/TableGen/2006-09-18-LargeInt.td
index 94cd1ec3071..53802123671 100644
--- a/test/TableGen/2006-09-18-LargeInt.td
+++ b/test/TableGen/2006-09-18-LargeInt.td
@@ -1,4 +1,6 @@
-// RUN: llvm-tblgen %s | grep -- 4294901760
+// RUN: llvm-tblgen %s | FileCheck %s
+
+// CHECK: 4294901760
def X {
int Y = 0xFFFF0000;
diff --git a/test/TableGen/DefmInherit.td b/test/TableGen/DefmInherit.td
index b52a709731e..ee86e9bd709 100644
--- a/test/TableGen/DefmInherit.td
+++ b/test/TableGen/DefmInherit.td
@@ -1,4 +1,10 @@
-// RUN: llvm-tblgen %s | grep "zing = 4" | count 4
+// RUN: llvm-tblgen %s | FileCheck %s
+
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK-NOT: zing = 4
class C1<int A, string B> {
int bar = A;
diff --git a/test/TableGen/DefmInsideMultiClass.td b/test/TableGen/DefmInsideMultiClass.td
index 0aea21280da..7353d3630b4 100644
--- a/test/TableGen/DefmInsideMultiClass.td
+++ b/test/TableGen/DefmInsideMultiClass.td
@@ -1,4 +1,7 @@
-// RUN: llvm-tblgen %s | grep ADDPSrr | count 1
+// RUN: llvm-tblgen %s | FileCheck %s
+
+// CHECK: ADDPSrr
+// CHECK-NOT: ADDPSrr
class Instruction<bits<4> opc, string Name> {
bits<4> opcode = opc;
diff --git a/test/TableGen/LazyChange.td b/test/TableGen/LazyChange.td
index 919a1a7e9a3..2ad6191c253 100644
--- a/test/TableGen/LazyChange.td
+++ b/test/TableGen/LazyChange.td
@@ -1,4 +1,6 @@
-// RUN: llvm-tblgen %s | grep "int Y = 3"
+// RUN: llvm-tblgen %s | FileCheck %s
+
+// CHECK: int Y = 3
class C {
int X = 4;
diff --git a/test/TableGen/LetInsideMultiClasses.td b/test/TableGen/LetInsideMultiClasses.td
index 72f48b6d806..cfa756df206 100644
--- a/test/TableGen/LetInsideMultiClasses.td
+++ b/test/TableGen/LetInsideMultiClasses.td
@@ -1,4 +1,9 @@
-// RUN: llvm-tblgen %s | grep "bit IsDouble = 1;" | count 3
+// RUN: llvm-tblgen %s | FileCheck %s
+
+// CHECK: bit IsDouble = 1;
+// CHECK: bit IsDouble = 1;
+// CHECK: bit IsDouble = 1;
+// CHECK-NOT: bit IsDouble = 1;
class Instruction<bits<4> opc, string Name> {
bits<4> opcode = opc;
diff --git a/test/TableGen/ListOfList.td b/test/TableGen/ListOfList.td
index adf9fe483eb..c646e3b4802 100644
--- a/test/TableGen/ListOfList.td
+++ b/test/TableGen/ListOfList.td
@@ -1,6 +1,4 @@
-// RUN llvm-tblgen %s | FileCheck %s
-
-// RUN: llvm-tblgen %s | grep "foo" | count 1
+// RUN: llvm-tblgen %s | FileCheck %s
class Base<string t> {
string text = t;
@@ -11,3 +9,4 @@ class Derived<list<list<string>> thetext> : Base<thetext[0][0]>;
def FOO : Derived<[["foo"]]>;
// CHECK: text = "foo"
+// CHECK-NOT: text = "foo"
diff --git a/test/TableGen/MultiClass.td b/test/TableGen/MultiClass.td
index ef320cf79f1..6b6cab11cb7 100644
--- a/test/TableGen/MultiClass.td
+++ b/test/TableGen/MultiClass.td
@@ -1,4 +1,8 @@
-// RUN: llvm-tblgen %s | grep "zing = 4" | count 2
+// RUN: llvm-tblgen %s | FileCheck %s
+
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK-NOT: zing = 4
class C1<int A, string B> {
int bar = A;
diff --git a/test/TableGen/MultiClassDefName.td b/test/TableGen/MultiClassDefName.td
index 75d6af5b42b..3ee5c10de4b 100644
--- a/test/TableGen/MultiClassDefName.td
+++ b/test/TableGen/MultiClassDefName.td
@@ -1,4 +1,7 @@
-// RUN: llvm-tblgen %s | grep WorldHelloCC | count 1
+// RUN: llvm-tblgen %s | FileCheck %s
+
+// CHECK: WorldHelloCC
+// CHECK-NOT: WorldHelloCC
class C<string n> {
string name = n;
diff --git a/test/TableGen/MultiClassInherit.td b/test/TableGen/MultiClassInherit.td
index 9d1470a6616..7a9be3d7e81 100644
--- a/test/TableGen/MultiClassInherit.td
+++ b/test/TableGen/MultiClassInherit.td
@@ -1,4 +1,35 @@
-// RUN: llvm-tblgen %s | grep "zing = 4" | count 28
+// RUN: llvm-tblgen %s | FileCheck %s
+
+// "zing = 4" x 28
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK: zing = 4
+// CHECK-NOT: zing = 4
class C1<int A, string B> {
int bar = A;
diff --git a/test/TableGen/TargetInstrSpec.td b/test/TableGen/TargetInstrSpec.td
index bf2d257c5d0..f23bec77d4d 100644
--- a/test/TableGen/TargetInstrSpec.td
+++ b/test/TableGen/TargetInstrSpec.td
@@ -1,5 +1,10 @@
-// RUN: llvm-tblgen %s | grep '\[(set VR128:$dst, (int_x86_sse2_add_pd VR128:$src1, VR128:$src2))\]' | count 1
-// RUN: llvm-tblgen %s | grep '\[(set VR128:$dst, (int_x86_sse2_add_ps VR128:$src1, VR128:$src2))\]' | count 1
+// RUN: llvm-tblgen %s | FileCheck %s
+
+// CHECK: [(set VR128:$dst, (int_x86_sse2_add_pd VR128:$src1, VR128:$src2))]
+// CHECK-NOT: [(set VR128:$dst, (int_x86_sse2_add_pd VR128:$src1, VR128:$src2))]
+
+// CHECK: [(set VR128:$dst, (int_x86_sse2_add_ps VR128:$src1, VR128:$src2))]
+// CHECK-NOT: [(set VR128:$dst, (int_x86_sse2_add_ps VR128:$src1, VR128:$src2))]
class ValueType<int size, int value> {
int Size = size;
diff --git a/test/TableGen/cast.td b/test/TableGen/cast.td
index b9e4b375359..7ca72394b6a 100644
--- a/test/TableGen/cast.td
+++ b/test/TableGen/cast.td
@@ -1,4 +1,9 @@
-// RUN: llvm-tblgen %s | grep "add_ps" | count 3
+// RUN: llvm-tblgen %s | FileCheck %s
+
+// CHECK: add_ps
+// CHECK: add_ps
+// CHECK: add_ps
+// CHECK-NOT: add_ps
class ValueType<int size, int value> {
int Size = size;
diff --git a/test/TableGen/foreach.td b/test/TableGen/foreach.td
index 7b7c1997288..fea8678c0ad 100644
--- a/test/TableGen/foreach.td
+++ b/test/TableGen/foreach.td
@@ -1,6 +1,13 @@
-// RUN: llvm-tblgen %s | grep 'Jr' | count 2
-// RUN: llvm-tblgen %s | grep 'Sr' | count 2
-// RUN: llvm-tblgen %s | grep '"NAME"' | count 1
+// RUN: llvm-tblgen %s | FileCheck %s
+
+// CHECK: Classes
+// CHECK: Sr
+// CHECK: Jr
+// CHECK: "NAME"
+
+// CHECK: Defs
+// CHECK: Jr
+// CHECK: Sr
// Variables for foreach
class decls {
diff --git a/test/TableGen/lisp.td b/test/TableGen/lisp.td
index efe00022f51..d753fbd299c 100644
--- a/test/TableGen/lisp.td
+++ b/test/TableGen/lisp.td
@@ -1,4 +1,19 @@
-// RUN: llvm-tblgen %s | grep ""
+// RUN: llvm-tblgen %s
+
+// CHECK: def One {
+// CHECK-NEXT: list<string> names = ["Jeffrey Sinclair"];
+// CHECK-NEXT: string element = "Jeffrey Sinclair";
+// CHECK-NEXT: list<string> rest = [];
+// CHECK-NEXT: int null = 1;
+// CHECK-NEXT: string NAME = ?;
+// CHECK-NEXT: }
+// CHECK-NEXT: def Three {
+// CHECK-NEXT: list<string> names = ["Tom", "Dick", "Harry"];
+// CHECK-NEXT: string element = "Tom";
+// CHECK-NEXT: list<string> rest = ["Dick", "Harry"];
+// CHECK-NEXT: int null = 0;
+// CHECK-NEXT: string NAME = ?;
+// CHECK-NEXT: }
class List<list<string> n> {
list<string> names = n;
diff --git a/test/TableGen/strconcat.td b/test/TableGen/strconcat.td
index 0173c49365c..dfb1a94d82c 100644
--- a/test/TableGen/strconcat.td
+++ b/test/TableGen/strconcat.td
@@ -1,4 +1,6 @@
-// RUN: llvm-tblgen %s | grep fufoo
+// RUN: llvm-tblgen %s | FileCheck %s
+
+// CHECK: fufoo
class Y<string S> {
string T = !strconcat(S, "foo");
diff --git a/test/TableGen/subst.td b/test/TableGen/subst.td
index e265b44cf32..b65c9289300 100644
--- a/test/TableGen/subst.td
+++ b/test/TableGen/subst.td
@@ -1,9 +1,4 @@
-// RUN: llvm-tblgen %s | grep "Smith" | count 7
-// RUN: llvm-tblgen %s | grep "Johnson" | count 2
-// RUN: llvm-tblgen %s | grep "FIRST" | count 1
-// RUN: llvm-tblgen %s | grep "LAST" | count 1
-// RUN: llvm-tblgen %s | grep "TVAR" | count 2
-// RUN: llvm-tblgen %s | grep "Bogus" | count 1
+// RUN: llvm-tblgen %s | FileCheck %s
class Honorific<string t> {
string honorific = t;
@@ -27,3 +22,56 @@ def JohnSmith : AName<"FIRST LAST", TVAR>;
def JaneSmith : AName<"Jane LAST", Ms>;
def JohnSmithJones : AName<"FIRST LAST-Jones", Mr>;
def JimmyJohnson : AName<"Jimmy Johnson", Mr>;
+
+// CHECK: ------------- Classes -----------------
+// CHECK-NEXT: class AName<string AName:name = ?, Honorific AName:honorific = ?> {
+// CHECK-NEXT: string name = !subst("FIRST", "John", !subst("LAST", "Smith", AName:name));
+// CHECK-NEXT: Honorific honorific = !subst(TVAR, Mr, AName:honorific);
+// CHECK-NEXT: string NAME = ?;
+// CHECK-NEXT: }
+// CHECK-NEXT: class Honorific<string Honorific:t = ?> {
+// CHECK-NEXT: string honorific = Honorific:t;
+// CHECK-NEXT: string NAME = ?;
+// CHECK-NEXT: }
+// CHECK-NEXT: class Name<string Name:n = ?, Honorific Name:t = ?> {
+// CHECK-NEXT: string name = Name:n;
+// CHECK-NEXT: Honorific honorific = Name:t;
+// CHECK-NEXT: string NAME = ?;
+// CHECK-NEXT: }
+// CHECK-NEXT: ------------- Defs -----------------
+// CHECK-NEXT: def JaneSmith {
+// CHECK-NEXT: string name = "Jane Smith";
+// CHECK-NEXT: Honorific honorific = Ms;
+// CHECK-NEXT: string NAME = ?;
+// CHECK-NEXT: }
+// CHECK-NEXT: def JimmyJohnson {
+// CHECK-NEXT: string name = "Jimmy Johnson";
+// CHECK-NEXT: Honorific honorific = Mr;
+// CHECK-NEXT: string NAME = ?;
+// CHECK-NEXT: }
+// CHECK-NEXT: def JohnSmith {
+// CHECK-NEXT: string name = "John Smith";
+// CHECK-NEXT: Honorific honorific = Mr;
+// CHECK-NEXT: string NAME = ?;
+// CHECK-NEXT: }
+// CHECK-NEXT: def JohnSmithJones {
+// CHECK-NEXT: string name = "John Smith-Jones";
+// CHECK-NEXT: Honorific honorific = Mr;
+// CHECK-NEXT: string NAME = ?;
+// CHECK-NEXT: }
+// CHECK-NEXT: def Mr
+// CHECK-NEXT: string honorific = "Mr.";
+// CHECK-NEXT: string NAME = ?;
+// CHECK-NEXT: }
+// CHECK-NEXT: def Mrs {
+// CHECK-NEXT: string honorific = "Mrs.";
+// CHECK-NEXT: string NAME = ?;
+// CHECK-NEXT: }
+// CHECK-NEXT: def Ms {
+// CHECK-NEXT: string honorific = "Ms.";
+// CHECK-NEXT: string NAME = ?;
+// CHECK-NEXT: }
+// CHECK-NEXT: def TVAR {
+// CHECK-NEXT: string honorific = "Bogus";
+// CHECK-NEXT: string NAME = ?;
+// CHECK-NEXT: }