aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-02 07:01:27 +0000
committerChris Lattner <sabre@nondot.org>2009-01-02 07:01:27 +0000
commitdf98617b23315e427cc4fad8ccfdd50d68bec2f9 (patch)
tree7ff121d47bf96432f608d5059916d6b7062e6d36 /test
parentccb6976a69a6e146db049fff8e6338e31c91b6f8 (diff)
downloadexternal_llvm-df98617b23315e427cc4fad8ccfdd50d68bec2f9.zip
external_llvm-df98617b23315e427cc4fad8ccfdd50d68bec2f9.tar.gz
external_llvm-df98617b23315e427cc4fad8ccfdd50d68bec2f9.tar.bz2
Reimplement the old and horrible bison parser for .ll files with a nice
and clean recursive descent parser. This change has a couple of ramifications: 1. The parser code is about 400 lines shorter (in what we maintain, not including what is autogenerated). 2. The code should be significantly faster than the old code because we don't have to work around bison's poor handling of datatypes with ctors/dtors. This also makes the code much more resistant to memory leaks. 3. We now get caret diagnostics from the .ll parser, woo. 4. The actual diagnostics emited from the parser are completely different so a bunch of testcases had to be updated. 5. I now disallow "%ty = type opaque %ty = type i32". There was no good reason to support this, it was just an accident of the old implementation. I have no reason to think that anyone is actually using this. 6. The syntax for sticking a global variable has changed to make it unambiguous. I don't think anyone is depending on this since only clang supports this and it is not solid yet, so I'm not worried about anything breaking. 7. This gets rid of the last use of bison, and along with it the .cvs files. I'll prune this from the makefiles as a subsequent commit. There are a few minor cleanups that can be done after this commit (suggestions welcome!) but this passes dejagnu testing and is ready for its time in the limelight. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61558 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Assembler/2002-07-25-ParserAssertionFailure.ll2
-rw-r--r--test/Assembler/2003-04-15-ConstantInitAssertion.ll2
-rw-r--r--test/Assembler/2003-05-21-MalformedShiftCrash.ll2
-rw-r--r--test/Assembler/2003-05-21-MalformedStructCrash.ll2
-rw-r--r--test/Assembler/2003-11-24-SymbolTableCrash.ll3
-rw-r--r--test/Assembler/2003-12-30-TypeMapInvalidMemory.ll2
-rw-r--r--test/Assembler/2004-03-30-UnclosedFunctionCrash.ll4
-rw-r--r--test/Assembler/2004-11-28-InvalidTypeCrash.ll3
-rw-r--r--test/Assembler/2006-09-28-CrashOnInvalid.ll2
-rw-r--r--test/Assembler/2007-01-02-Undefined-Arg-Type.ll2
-rw-r--r--test/Assembler/2007-03-18-InvalidNumberedVar.ll2
-rw-r--r--test/Assembler/2007-08-06-AliasInvalid.ll6
-rw-r--r--test/Assembler/2007-12-11-AddressSpaces.ll6
-rw-r--r--test/Assembler/2008-02-18-IntPointerCrash.ll2
-rw-r--r--test/Feature/globalredefinition3.ll4
-rw-r--r--test/Feature/opaquetypes.ll2
-rw-r--r--test/Integer/opaquetypes_bt.ll2
-rw-r--r--test/Linker/2008-06-26-AddressSpace.ll2
-rw-r--r--test/Transforms/GlobalOpt/2008-07-17-addrspace.ll4
-rw-r--r--test/Verifier/2002-11-05-GetelementptrPointers.ll2
-rw-r--r--test/Verifier/2005-03-21-UndefinedTypeReference.ll2
-rw-r--r--test/Verifier/2006-10-15-AddrLabel.ll3
22 files changed, 27 insertions, 34 deletions
diff --git a/test/Assembler/2002-07-25-ParserAssertionFailure.ll b/test/Assembler/2002-07-25-ParserAssertionFailure.ll
index e1fa934..29c7c02 100644
--- a/test/Assembler/2002-07-25-ParserAssertionFailure.ll
+++ b/test/Assembler/2002-07-25-ParserAssertionFailure.ll
@@ -1,6 +1,6 @@
; Make sure we don't get an assertion failure, even though this is a parse
; error
-; RUN: not llvm-as %s -o /dev/null -f |& grep {No arguments}
+; RUN: not llvm-as %s -o /dev/null -f |& grep {'@foo' defined with}
%ty = type void (i32)
diff --git a/test/Assembler/2003-04-15-ConstantInitAssertion.ll b/test/Assembler/2003-04-15-ConstantInitAssertion.ll
index 66b80de..e012168 100644
--- a/test/Assembler/2003-04-15-ConstantInitAssertion.ll
+++ b/test/Assembler/2003-04-15-ConstantInitAssertion.ll
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s >/dev/null |& grep {Expected type 'i32' for element #0}
+; RUN: not llvm-as < %s >/dev/null |& grep {constant expression type mismatch}
; Test the case of a misformed constant initializer
; This should cause an assembler error, not an assertion failure!
constant { i32 } { float 1.0 }
diff --git a/test/Assembler/2003-05-21-MalformedShiftCrash.ll b/test/Assembler/2003-05-21-MalformedShiftCrash.ll
index d573403..c661f7c 100644
--- a/test/Assembler/2003-05-21-MalformedShiftCrash.ll
+++ b/test/Assembler/2003-05-21-MalformedShiftCrash.ll
@@ -1,4 +1,4 @@
; Found by inspection of the code
-; RUN: not llvm-as < %s > /dev/null |& grep {Logical operator requires integral}
+; RUN: not llvm-as < %s > /dev/null |& grep {constexpr requires integer or integer vector operands}
global i32 ashr (float 1.0, float 2.0)
diff --git a/test/Assembler/2003-05-21-MalformedStructCrash.ll b/test/Assembler/2003-05-21-MalformedStructCrash.ll
index bf93035..1efb577 100644
--- a/test/Assembler/2003-05-21-MalformedStructCrash.ll
+++ b/test/Assembler/2003-05-21-MalformedStructCrash.ll
@@ -1,4 +1,4 @@
; Found by inspection of the code
-; RUN: not llvm-as < %s > /dev/null |& grep {Illegal number of init}
+; RUN: not llvm-as < %s > /dev/null |& grep {constant expression type mismatch}
global {} { i32 7, float 1.0, i32 7, i32 8 }
diff --git a/test/Assembler/2003-11-24-SymbolTableCrash.ll b/test/Assembler/2003-11-24-SymbolTableCrash.ll
index 4b2cbdc..041b0d9 100644
--- a/test/Assembler/2003-11-24-SymbolTableCrash.ll
+++ b/test/Assembler/2003-11-24-SymbolTableCrash.ll
@@ -1,5 +1,4 @@
-; RUN: not llvm-as < %s |& not grep Asserti
-; RUN: not llvm-as < %s |& grep Redefinition
+; RUN: not llvm-as < %s |& grep {multiple definition}
define void @test() {
%tmp.1 = add i32 0, 1
diff --git a/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll b/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll
index db39490..bdb4d54 100644
--- a/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll
+++ b/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll
@@ -1,4 +1,4 @@
-; RUN: not llvm-as %s -o /dev/null -f |& grep {Undefined type remains}
+; RUN: not llvm-as %s -o /dev/null -f |& grep {use of undefined type named 'struct.D_Scope'}
; END.
@d_reduction_0_dparser_gram = global {
diff --git a/test/Assembler/2004-03-30-UnclosedFunctionCrash.ll b/test/Assembler/2004-03-30-UnclosedFunctionCrash.ll
index 62a7138..775b755 100644
--- a/test/Assembler/2004-03-30-UnclosedFunctionCrash.ll
+++ b/test/Assembler/2004-03-30-UnclosedFunctionCrash.ll
@@ -1,3 +1,3 @@
-; RUN: not llvm-as %s |& grep error
+; RUN: not llvm-as %s |& grep {found end of file when expecting more instructions}
-void %foo() {
+define void @foo() {
diff --git a/test/Assembler/2004-11-28-InvalidTypeCrash.ll b/test/Assembler/2004-11-28-InvalidTypeCrash.ll
index 5f80077..6f26439 100644
--- a/test/Assembler/2004-11-28-InvalidTypeCrash.ll
+++ b/test/Assembler/2004-11-28-InvalidTypeCrash.ll
@@ -1,5 +1,4 @@
; Test for PR463. This program is erroneous, but should not crash llvm-as.
-; RUN: not llvm-as %s -o /dev/null -f |& \
-; RUN: grep {Cannot create a null initialized value of this type}
+; RUN: not llvm-as %s -o /dev/null -f |& grep {invalid type for null constant}
@.FOO = internal global %struct.none zeroinitializer
diff --git a/test/Assembler/2006-09-28-CrashOnInvalid.ll b/test/Assembler/2006-09-28-CrashOnInvalid.ll
index f77ea5c..a203c6a 100644
--- a/test/Assembler/2006-09-28-CrashOnInvalid.ll
+++ b/test/Assembler/2006-09-28-CrashOnInvalid.ll
@@ -1,6 +1,6 @@
; Test for PR902. This program is erroneous, but should not crash llvm-as.
; This tests that a simple error is caught and processed correctly.
-; RUN: not llvm-as < %s >/dev/null |& grep {FP constant invalid for type}
+; RUN: not llvm-as < %s >/dev/null |& grep {floating point constant invalid for type}
define void @test() {
add i32 1, 2.0
diff --git a/test/Assembler/2007-01-02-Undefined-Arg-Type.ll b/test/Assembler/2007-01-02-Undefined-Arg-Type.ll
index 9521b43..1962ae7 100644
--- a/test/Assembler/2007-01-02-Undefined-Arg-Type.ll
+++ b/test/Assembler/2007-01-02-Undefined-Arg-Type.ll
@@ -1,5 +1,5 @@
; The assembler should catch an undefined argument type .
-; RUN: not llvm-as %s -o /dev/null -f |& grep {Reference to abstract argument}
+; RUN: not llvm-as %s -o /dev/null -f |& grep {use of undefined type named 'typedef.bc_struct'}
; %typedef.bc_struct = type opaque
diff --git a/test/Assembler/2007-03-18-InvalidNumberedVar.ll b/test/Assembler/2007-03-18-InvalidNumberedVar.ll
index 8e82113..12bac61 100644
--- a/test/Assembler/2007-03-18-InvalidNumberedVar.ll
+++ b/test/Assembler/2007-03-18-InvalidNumberedVar.ll
@@ -1,5 +1,5 @@
; PR 1258
-; RUN: not llvm-as < %s >/dev/null -f |& grep {Numbered.*does not match}
+; RUN: not llvm-as < %s >/dev/null -f |& grep {'%0' defined with type 'i1'}
define i32 @test1(i32 %a, i32 %b) {
entry:
diff --git a/test/Assembler/2007-08-06-AliasInvalid.ll b/test/Assembler/2007-08-06-AliasInvalid.ll
index b54acec..940959824 100644
--- a/test/Assembler/2007-08-06-AliasInvalid.ll
+++ b/test/Assembler/2007-08-06-AliasInvalid.ll
@@ -1,7 +1,9 @@
-; RUN: not llvm-as < %s > /dev/null |& grep {Invalid type for reference to global}
+; RUN: not llvm-as < %s > /dev/null |& grep {expected top-level entity}
; PR1577
-@anInt = global i32 1 alias i32 @anAlias
+@anInt = global i32 1
+alias i32 @anAlias
+
define i32 @main() {
ret i32 0
}
diff --git a/test/Assembler/2007-12-11-AddressSpaces.ll b/test/Assembler/2007-12-11-AddressSpaces.ll
index 16d0130..0eb4a79 100644
--- a/test/Assembler/2007-12-11-AddressSpaces.ll
+++ b/test/Assembler/2007-12-11-AddressSpaces.ll
@@ -5,9 +5,9 @@
; RUN: llvm-as < %s | llvm-dis | grep {addrspace(22)} | count 5
%struct.mystruct = type { i32, i32 addrspace(33)*, i32, i32 addrspace(33)* }
-@input = weak global %struct.mystruct zeroinitializer addrspace(42) ; <%struct.mystruct addrspace(42)*> [#uses=1]
-@output = global %struct.mystruct zeroinitializer addrspace(66) ; <%struct.mystruct addrspace(66)*> [#uses=1]
-@y = external global i32 addrspace(11)* addrspace(22)* addrspace(33) ; <i32 addrspace(11)* addrspace(22)* addrspace(33)*> [#uses=1]
+@input = weak addrspace(42) global %struct.mystruct zeroinitializer ; <%struct.mystruct addrspace(42)*> [#uses=1]
+@output = addrspace(66) global %struct.mystruct zeroinitializer ; <%struct.mystruct addrspace(66)*> [#uses=1]
+@y = external addrspace(33) global i32 addrspace(11)* addrspace(22)* ; <i32 addrspace(11)* addrspace(22)* addrspace(33)*> [#uses=1]
define void @foo() {
entry:
diff --git a/test/Assembler/2008-02-18-IntPointerCrash.ll b/test/Assembler/2008-02-18-IntPointerCrash.ll
index 69632ae..5a661ad 100644
--- a/test/Assembler/2008-02-18-IntPointerCrash.ll
+++ b/test/Assembler/2008-02-18-IntPointerCrash.ll
@@ -1,4 +1,4 @@
-; RUN: not llvm-as %s |& grep {is invalid or}
+; RUN: not llvm-as %s |& grep {integer constant must have integer type}
; PR2060
define i8* @foo() {
diff --git a/test/Feature/globalredefinition3.ll b/test/Feature/globalredefinition3.ll
index bbac2e9..0183e5a 100644
--- a/test/Feature/globalredefinition3.ll
+++ b/test/Feature/globalredefinition3.ll
@@ -1,6 +1,4 @@
-; RUN: not llvm-as %s -o /dev/null -f |& grep \
-; RUN: "Redefinition of global variable named 'B'"
-; END.
+; RUN: not llvm-as %s -o /dev/null -f |& grep {redefinition of global '@B'}
@B = global i32 7
@B = global i32 7
diff --git a/test/Feature/opaquetypes.ll b/test/Feature/opaquetypes.ll
index 2ca58a7..6539c1a 100644
--- a/test/Feature/opaquetypes.ll
+++ b/test/Feature/opaquetypes.ll
@@ -7,7 +7,6 @@
;
%SQ1 = type { i32 }
-%ITy = type opaque
%SQ2 = type { %ITy }
%ITy = type i32
@@ -22,7 +21,6 @@ type %BBB
%Composite = type { %0, %1 }
; Test simple opaque type resolution...
-%intty = type opaque
%intty = type i32
; Perform a simple forward reference...
diff --git a/test/Integer/opaquetypes_bt.ll b/test/Integer/opaquetypes_bt.ll
index a1ba799..5771342 100644
--- a/test/Integer/opaquetypes_bt.ll
+++ b/test/Integer/opaquetypes_bt.ll
@@ -7,7 +7,6 @@
;
%SQ1 = type { i31 }
-%ITy = type opaque
%SQ2 = type { %ITy }
%ITy = type i31
@@ -22,7 +21,6 @@ type %BBB
%Composite = type { %0, %1 }
; Test simple opaque type resolution...
-%i31ty = type opaque
%i31ty = type i31
; Perform a simple forward reference...
diff --git a/test/Linker/2008-06-26-AddressSpace.ll b/test/Linker/2008-06-26-AddressSpace.ll
index ee47509..7f21106 100644
--- a/test/Linker/2008-06-26-AddressSpace.ll
+++ b/test/Linker/2008-06-26-AddressSpace.ll
@@ -6,4 +6,4 @@
; RUN: llvm-link %t.foo1.bc %t.foo2.bc | llvm-dis | grep {addrspace(2)}
; rdar://6038021
-@G = global i32 256 addrspace(2)
+@G = addrspace(2) global i32 256
diff --git a/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll b/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll
index fd9d088..735a84d 100644
--- a/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll
+++ b/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll
@@ -6,8 +6,8 @@
; Check that the new global values still have their address space
; RUN: cat %t | grep global.*addrspace
-@struct = internal global { i32, i32 } zeroinitializer addrspace(1)
-@array = internal global [ 2 x i32 ] zeroinitializer addrspace(1)
+@struct = internal addrspace(1) global { i32, i32 } zeroinitializer
+@array = internal addrspace(1) global [ 2 x i32 ] zeroinitializer
define i32 @foo() {
%A = load i32 addrspace(1) * getelementptr ({ i32, i32 } addrspace(1) * @struct, i32 0, i32 0)
diff --git a/test/Verifier/2002-11-05-GetelementptrPointers.ll b/test/Verifier/2002-11-05-GetelementptrPointers.ll
index e37a0ff..1f71387 100644
--- a/test/Verifier/2002-11-05-GetelementptrPointers.ll
+++ b/test/Verifier/2002-11-05-GetelementptrPointers.ll
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s |& grep {Invalid getelementptr indices}
+; RUN: not llvm-as < %s |& grep {invalid getelementptr indices}
; This testcase is invalid because we are indexing into a pointer that is
; contained WITHIN a structure.
diff --git a/test/Verifier/2005-03-21-UndefinedTypeReference.ll b/test/Verifier/2005-03-21-UndefinedTypeReference.ll
index 19a9826..5299397 100644
--- a/test/Verifier/2005-03-21-UndefinedTypeReference.ll
+++ b/test/Verifier/2005-03-21-UndefinedTypeReference.ll
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s |& grep {Reference to an undefined type}
+; RUN: not llvm-as < %s |& grep {use of undefined type named 'InvalidType'}
define void @test() {
malloc %InvalidType
diff --git a/test/Verifier/2006-10-15-AddrLabel.ll b/test/Verifier/2006-10-15-AddrLabel.ll
index e2c0e60..73b6902 100644
--- a/test/Verifier/2006-10-15-AddrLabel.ll
+++ b/test/Verifier/2006-10-15-AddrLabel.ll
@@ -1,5 +1,4 @@
-; RUN: not llvm-as < %s > /dev/null |& \
-; RUN: grep {Cannot form a pointer to a basic block}
+; RUN: not llvm-as < %s > /dev/null |& grep {basic block pointers are invalid}
define i32 @main() {
%foo = call i8* %llvm.stacksave()