summaryrefslogtreecommitdiff
path: root/test/Assembler
diff options
context:
space:
mode:
Diffstat (limited to 'test/Assembler')
-rw-r--r--test/Assembler/2002-01-24-BadSymbolTableAssert.ll11
-rw-r--r--test/Assembler/2002-01-24-ValueRefineAbsType.ll23
-rw-r--r--test/Assembler/2002-02-19-TypeParsing.ll3
-rw-r--r--test/Assembler/2002-03-08-NameCollision.ll15
-rw-r--r--test/Assembler/2002-03-08-NameCollision2.ll12
-rw-r--r--test/Assembler/2002-04-04-PureVirtMethCall.ll6
-rw-r--r--test/Assembler/2002-04-04-PureVirtMethCall2.ll5
-rw-r--r--test/Assembler/2002-04-05-TypeParsing.ll3
-rw-r--r--test/Assembler/2002-04-07-HexFloatConstants.ll16
-rw-r--r--test/Assembler/2002-04-07-InfConstant.ll9
-rw-r--r--test/Assembler/2002-04-29-NameBinding.ll18
-rw-r--r--test/Assembler/2002-05-02-InvalidForwardRef.ll10
-rw-r--r--test/Assembler/2002-05-02-ParseError.ll7
-rw-r--r--test/Assembler/2002-07-08-HugePerformanceProblem.ll67
-rw-r--r--test/Assembler/2002-07-14-InternalLossage.ll9
-rw-r--r--test/Assembler/2002-07-14-OpaqueType.ll10
-rw-r--r--test/Assembler/2002-07-25-ParserAssertionFailure.ll13
-rw-r--r--test/Assembler/2002-07-25-QuoteInString.ll5
-rw-r--r--test/Assembler/2002-07-25-ReturnPtrFunction.ll15
-rw-r--r--test/Assembler/2002-07-31-SlashInString.ll5
-rw-r--r--test/Assembler/2002-08-15-CastAmbiguity.ll6
-rw-r--r--test/Assembler/2002-08-15-ConstantExprProblem.ll16
-rw-r--r--test/Assembler/2002-08-15-UnresolvedGlobalReference.ll8
-rw-r--r--test/Assembler/2002-08-16-ConstExprInlined.ll22
-rw-r--r--test/Assembler/2002-08-19-BytecodeReader.ll17
-rw-r--r--test/Assembler/2002-08-22-DominanceProblem.ll17
-rw-r--r--test/Assembler/2002-10-08-LargeArrayPerformance.ll8
-rw-r--r--test/Assembler/2002-10-13-ConstantEncodingProblem.ll5
-rw-r--r--test/Assembler/2002-10-15-NameClash.ll7
-rw-r--r--test/Assembler/2002-12-15-GlobalResolve.ll7
-rw-r--r--test/Assembler/2003-01-30-UnsignedString.ll4
-rw-r--r--test/Assembler/2003-04-15-ConstantInitAssertion.ll4
-rw-r--r--test/Assembler/2003-04-25-UnresolvedGlobalReference.ll7
-rw-r--r--test/Assembler/2003-05-03-BytecodeReaderProblem.ll6
-rw-r--r--test/Assembler/2003-05-12-MinIntProblem.ll5
-rw-r--r--test/Assembler/2003-05-15-AssemblerProblem.ll14
-rw-r--r--test/Assembler/2003-05-15-SwitchBug.ll11
-rw-r--r--test/Assembler/2003-05-21-ConstantShiftExpr.ll4
-rw-r--r--test/Assembler/2003-05-21-EmptyStructTest.ll6
-rw-r--r--test/Assembler/2003-05-21-MalformedShiftCrash.ll4
-rw-r--r--test/Assembler/2003-05-21-MalformedStructCrash.ll4
-rw-r--r--test/Assembler/2003-06-17-InvokeDisassemble.ll9
-rw-r--r--test/Assembler/2003-06-30-RecursiveTypeProblem.ll3
-rw-r--r--test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll16
-rw-r--r--test/Assembler/2003-08-21-ConstantExprCast-Fold.ll4
-rw-r--r--test/Assembler/2003-10-04-NotMergingGlobalConstants.ll6
-rw-r--r--test/Assembler/2003-11-05-ConstantExprShift.ll5
-rw-r--r--test/Assembler/2003-11-11-ImplicitRename.ll8
-rw-r--r--test/Assembler/2003-11-12-ConstantExprCast.ll10
-rw-r--r--test/Assembler/2003-11-24-SymbolTableCrash.ll10
-rw-r--r--test/Assembler/2003-12-30-TypeMapInvalidMemory.ll55
-rw-r--r--test/Assembler/2004-01-11-getelementptrfolding.ll12
-rw-r--r--test/Assembler/2004-01-20-MaxLongLong.ll4
-rw-r--r--test/Assembler/2004-02-01-NegativeZero.ll5
-rw-r--r--test/Assembler/2004-02-27-SelfUseAssertError.ll25
-rw-r--r--test/Assembler/2004-03-07-FunctionAddressAlignment.ll15
-rw-r--r--test/Assembler/2004-03-30-UnclosedFunctionCrash.ll3
-rw-r--r--test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll10
-rw-r--r--test/Assembler/2004-06-07-VerifierBug.ll11
-rw-r--r--test/Assembler/2004-10-22-BCWriterUndefBug.ll5
-rw-r--r--test/Assembler/2004-11-28-InvalidTypeCrash.ll4
-rw-r--r--test/Assembler/2005-01-03-FPConstantDisassembly.ll6
-rw-r--r--test/Assembler/2005-01-31-CallingAggregateFunction.ll8
-rw-r--r--test/Assembler/2005-02-09-AsmWriterStoreBug.ll14
-rw-r--r--test/Assembler/2005-05-05-OpaqueUndefValues.ll4
-rw-r--r--test/Assembler/2005-12-21-ZeroInitVector.ll6
-rw-r--r--test/Assembler/2006-05-26-VarargsCallEncode.ll8
-rw-r--r--test/Assembler/2006-09-28-CrashOnInvalid.ll8
-rw-r--r--test/Assembler/2006-12-09-Cast-To-Bool.ll6
-rw-r--r--test/Assembler/2007-01-02-Undefined-Arg-Type.ll9
-rw-r--r--test/Assembler/2007-01-05-Cmp-ConstExpr.ll18
-rw-r--r--test/Assembler/2007-01-16-CrashOnBadCast.ll7
-rw-r--r--test/Assembler/2007-01-16-CrashOnBadCast2.ll4
-rw-r--r--test/Assembler/2007-03-18-InvalidNumberedVar.ll9
-rw-r--r--test/Assembler/2007-03-19-NegValue.ll7
-rw-r--r--test/Assembler/2007-04-20-AlignedLoad.ll7
-rw-r--r--test/Assembler/2007-04-20-AlignedStore.ll7
-rw-r--r--test/Assembler/2007-04-25-AssemblerFoldExternWeak.ll6
-rw-r--r--test/Assembler/2007-05-21-Escape.ll22
-rw-r--r--test/Assembler/2007-07-19-ParamAttrAmbiguity.ll9
-rw-r--r--test/Assembler/2007-07-30-AutoUpgradeZextSext.ll12
-rw-r--r--test/Assembler/2007-08-06-AliasInvalid.ll9
-rw-r--r--test/Assembler/2007-09-10-AliasFwdRef.ll9
-rw-r--r--test/Assembler/2007-09-29-GC.ll12
-rw-r--r--test/Assembler/2007-11-26-AttributeOverload.ll4
-rw-r--r--test/Assembler/2007-11-27-AutoUpgradeAttributes.ll3
-rw-r--r--test/Assembler/2007-12-11-AddressSpaces.ll25
-rw-r--r--test/Assembler/2008-01-11-VarargAttrs.ll10
-rw-r--r--test/Assembler/2008-02-18-IntPointerCrash.ll6
-rw-r--r--test/Assembler/2008-02-20-MultipleReturnValue.ll22
-rw-r--r--test/Assembler/2008-07-10-APInt.ll9
-rw-r--r--test/Assembler/2008-09-02-FunctionNotes.ll14
-rw-r--r--test/Assembler/2008-09-02-FunctionNotes2.ll6
-rw-r--r--test/Assembler/2008-09-29-RetAttr.ll13
-rw-r--r--test/Assembler/2008-10-14-NamedTypeOnInteger.ll6
-rw-r--r--test/Assembler/2008-10-14-QuoteInName.ll3
-rw-r--r--test/Assembler/2009-02-01-UnnamedForwardRef.ll6
-rw-r--r--test/Assembler/2009-02-28-CastOpc.ll8
-rw-r--r--test/Assembler/2009-02-28-StripOpaqueName.ll6
-rw-r--r--test/Assembler/2009-03-24-ZextConstantExpr.ll11
-rw-r--r--test/Assembler/2009-04-25-AliasGEP.ll8
-rw-r--r--test/Assembler/AutoUpgradeIntrinsics.ll81
-rw-r--r--test/Assembler/ConstantExprFold.ll30
-rw-r--r--test/Assembler/ConstantExprFoldCast.ll14
-rw-r--r--test/Assembler/MultipleReturnValueType.ll13
-rw-r--r--test/Assembler/aggregate-constant-values.ll27
-rw-r--r--test/Assembler/aggregate-return-single-value.ll14
-rw-r--r--test/Assembler/anon-functions.ll26
-rw-r--r--test/Assembler/bcwrap.ll9
-rw-r--r--test/Assembler/dg.exp3
-rw-r--r--test/Assembler/getelementptr.ll12
-rw-r--r--test/Assembler/getelementptr_struct.ll12
-rw-r--r--test/Assembler/huge-array.ll5
-rw-r--r--test/Assembler/insertextractvalue.ll23
-rw-r--r--test/Assembler/numbered-values.ll16
-rw-r--r--test/Assembler/private.ll9
-rw-r--r--test/Assembler/select.ll9
-rw-r--r--test/Assembler/vbool-cmp.ll15
-rw-r--r--test/Assembler/vector-cmp.ll16
-rw-r--r--test/Assembler/vector-select.ll11
-rw-r--r--test/Assembler/vector-shift.ll32
121 files changed, 1408 insertions, 0 deletions
diff --git a/test/Assembler/2002-01-24-BadSymbolTableAssert.ll b/test/Assembler/2002-01-24-BadSymbolTableAssert.ll
new file mode 100644
index 000000000000..b2a48f556893
--- /dev/null
+++ b/test/Assembler/2002-01-24-BadSymbolTableAssert.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+; This testcase failed due to a bad assertion in SymbolTable.cpp, removed in
+; the 1.20 revision. Basically the symbol table assumed that if there was an
+; abstract type in the symbol table, [in this case for the entry %foo of type
+; void(opaque)* ], that there should have also been named types by now. This
+; was obviously not the case here, and this is valid. Assertion disabled.
+
+%bb = type i32
+
+declare void @foo(i32)
diff --git a/test/Assembler/2002-01-24-ValueRefineAbsType.ll b/test/Assembler/2002-01-24-ValueRefineAbsType.ll
new file mode 100644
index 000000000000..fb7c4fbf587f
--- /dev/null
+++ b/test/Assembler/2002-01-24-ValueRefineAbsType.ll
@@ -0,0 +1,23 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+; This testcase used to fail due to a lack of this diff in Value.cpp:
+; diff -r1.16 Value.cpp
+; 11c11
+; < #include "llvm/Type.h"
+; ---
+; > #include "llvm/DerivedTypes.h"
+; 74c74,76
+; < assert(Ty.get() == (const Type*)OldTy &&"Can't refine anything but my type!");
+; ---
+; > assert(Ty.get() == OldTy &&"Can't refine anything but my type!");
+; > if (OldTy == NewTy && !OldTy->isAbstract())
+; > Ty.removeUserFromConcrete();
+;
+; This was causing an assertion failure, due to the "foo" Method object never
+; releasing it's reference to the opaque %bb value.
+;
+
+%bb = type i32
+%exception_descriptor = type i32
+
+declare void @foo(i32)
diff --git a/test/Assembler/2002-02-19-TypeParsing.ll b/test/Assembler/2002-02-19-TypeParsing.ll
new file mode 100644
index 000000000000..b7cadbdb0568
--- /dev/null
+++ b/test/Assembler/2002-02-19-TypeParsing.ll
@@ -0,0 +1,3 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+%Hosp = type { i32, i32, i32, { \2*, { i32, i32, i32, { [4 x \3], \2, \5, %Hosp, i32, i32 }* }*, \2* }, { \2*, { i32, i32, i32, { [4 x \3], \2, \5, %Hosp, i32, i32 }* }*, \2* }, { \2*, { i32, i32, i32, { [4 x \3], \2, \5, %Hosp, i32, i32 }* }*, \2* }, { \2*, { i32, i32, i32, { [4 x \3], \2, \5, %Hosp, i32, i32 }* }*, \2* } }
diff --git a/test/Assembler/2002-03-08-NameCollision.ll b/test/Assembler/2002-03-08-NameCollision.ll
new file mode 100644
index 000000000000..539dfd671988
--- /dev/null
+++ b/test/Assembler/2002-03-08-NameCollision.ll
@@ -0,0 +1,15 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+; Method arguments were being checked for collisions at the global scope before
+; the method object was created by the parser. Because of this, false
+; collisions could occur that would cause the following error message to be
+; produced:
+;
+; Redefinition of value named 'X' in the 'int *' type plane!
+;
+; Fixed by delaying binding of variable names until _after_ the method symtab is
+; created.
+;
+@X = global i32 4 ; <i32*> [#uses=0]
+
+declare i32 @xxx(i32*)
diff --git a/test/Assembler/2002-03-08-NameCollision2.ll b/test/Assembler/2002-03-08-NameCollision2.ll
new file mode 100644
index 000000000000..57dc517d3bb0
--- /dev/null
+++ b/test/Assembler/2002-03-08-NameCollision2.ll
@@ -0,0 +1,12 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+; Another name collision problem. Here the problem was that if a forward
+; declaration for a method was found, that this would cause spurious conflicts
+; to be detected between locals and globals.
+;
+@Var = external global i32 ; <i32*> [#uses=0]
+
+define void @foo() {
+ %Var = alloca i32 ; <i32*> [#uses=0]
+ ret void
+}
diff --git a/test/Assembler/2002-04-04-PureVirtMethCall.ll b/test/Assembler/2002-04-04-PureVirtMethCall.ll
new file mode 100644
index 000000000000..4c63e44e9d21
--- /dev/null
+++ b/test/Assembler/2002-04-04-PureVirtMethCall.ll
@@ -0,0 +1,6 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+ type { { \2 *, \4 ** },
+ { \2 *, \4 ** }
+ }
+
diff --git a/test/Assembler/2002-04-04-PureVirtMethCall2.ll b/test/Assembler/2002-04-04-PureVirtMethCall2.ll
new file mode 100644
index 000000000000..553401f56367
--- /dev/null
+++ b/test/Assembler/2002-04-04-PureVirtMethCall2.ll
@@ -0,0 +1,5 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+%t = type { { \2*, \2 },
+ { \2*, \2 }
+ }
diff --git a/test/Assembler/2002-04-05-TypeParsing.ll b/test/Assembler/2002-04-05-TypeParsing.ll
new file mode 100644
index 000000000000..82db75f1ce97
--- /dev/null
+++ b/test/Assembler/2002-04-05-TypeParsing.ll
@@ -0,0 +1,3 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+ %Hosp = type { { \2*, { \2, %Hosp }* }, { \2*, { \2, %Hosp }* } }
diff --git a/test/Assembler/2002-04-07-HexFloatConstants.ll b/test/Assembler/2002-04-07-HexFloatConstants.ll
new file mode 100644
index 000000000000..b9860b3ac5a1
--- /dev/null
+++ b/test/Assembler/2002-04-07-HexFloatConstants.ll
@@ -0,0 +1,16 @@
+; This testcase checks to make sure that the assembler can handle floating
+; point constants in IEEE hex format. This also checks that the disassembler,
+; when presented with a FP constant that cannot be represented exactly in
+; exponential form, outputs it correctly in hex format. This is a distillation
+; of the bug that was causing the Olden Health benchmark to output incorrect
+; results!
+;
+; RUN: llvm-as < %s | opt -constprop | llvm-dis > %t.1
+; RUN: llvm-as < %s | llvm-dis | llvm-as | opt -constprop | \
+; RUN: llvm-dis > %t.2
+; RUN: diff %t.1 %t.2
+
+define double @test() {
+ %tmp = mul double 7.200000e+101, 0x427F4000 ; <double> [#uses=1]
+ ret double %tmp
+}
diff --git a/test/Assembler/2002-04-07-InfConstant.ll b/test/Assembler/2002-04-07-InfConstant.ll
new file mode 100644
index 000000000000..317b8f3654c3
--- /dev/null
+++ b/test/Assembler/2002-04-07-InfConstant.ll
@@ -0,0 +1,9 @@
+; The output formater prints out 1.0e100 as Inf!
+;
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep 0x7FF0000000000000
+
+define float @test() {
+ %tmp = mul float 0x7FF0000000000000, 1.000000e+01 ; <float> [#uses=1]
+ ret float %tmp
+}
+
diff --git a/test/Assembler/2002-04-29-NameBinding.ll b/test/Assembler/2002-04-29-NameBinding.ll
new file mode 100644
index 000000000000..9665aef14323
--- /dev/null
+++ b/test/Assembler/2002-04-29-NameBinding.ll
@@ -0,0 +1,18 @@
+; There should be NO references to the global v1. The local v1 should
+; have all of the references!
+;
+; Check by running globaldce, which will remove the constant if there are
+; no references to it!
+;
+; RUN: llvm-as < %s | opt -globaldce | llvm-dis | \
+; RUN: not grep constant
+;
+
+@v1 = internal constant i32 5
+
+define i32 @createtask() {
+ %v1 = alloca i32 ;; Alloca should have one use!
+ %reg112 = load i32* %v1 ;; This load should not use the global!
+ ret i32 %reg112
+}
+
diff --git a/test/Assembler/2002-05-02-InvalidForwardRef.ll b/test/Assembler/2002-05-02-InvalidForwardRef.ll
new file mode 100644
index 000000000000..00a0a0153776
--- /dev/null
+++ b/test/Assembler/2002-05-02-InvalidForwardRef.ll
@@ -0,0 +1,10 @@
+; RUN: llvm-as %s -o /dev/null -f
+; It looks like the assembler is not forward resolving the function declaraion
+; correctly.
+
+define void @test() {
+ call void @foo( )
+ ret void
+}
+
+declare void @foo()
diff --git a/test/Assembler/2002-05-02-ParseError.ll b/test/Assembler/2002-05-02-ParseError.ll
new file mode 100644
index 000000000000..b198edfd31f5
--- /dev/null
+++ b/test/Assembler/2002-05-02-ParseError.ll
@@ -0,0 +1,7 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+%T = type i32 *
+
+define %T @test() {
+ ret %T null
+}
diff --git a/test/Assembler/2002-07-08-HugePerformanceProblem.ll b/test/Assembler/2002-07-08-HugePerformanceProblem.ll
new file mode 100644
index 000000000000..b9ebfbe2ad61
--- /dev/null
+++ b/test/Assembler/2002-07-08-HugePerformanceProblem.ll
@@ -0,0 +1,67 @@
+; This file takes about 48 __MINUTES__ to assemble using as. This is WAY too
+; long. The type resolution code needs to be sped up a lot.
+; RUN: llvm-as %s -o /dev/null -f
+ %ALL_INTERSECTIONS_METHOD = type i32 (%OBJECT*, %RAY*, %ISTACK*)*
+ %BBOX = type { %BBOX_VECT, %BBOX_VECT }
+ %BBOX_TREE = type { i16, i16, %BBOX, %BBOX_TREE** }
+ %BBOX_VECT = type [3 x float]
+ %BLEND_MAP = type { i16, i16, i16, i32, %BLEND_MAP_ENTRY* }
+ %BLEND_MAP_ENTRY = type { float, i8, { %COLOUR, %PIGMENT*, %TNORMAL*, %TEXTURE*, %UV_VECT } }
+ %CAMERA = type { %VECTOR, %VECTOR, %VECTOR, %VECTOR, %VECTOR, %VECTOR, double, double, i32, double, double, i32, double, %TNORMAL* }
+ %COLOUR = type [5 x float]
+ %COPY_METHOD = type i8* (%OBJECT*)*
+ %COUNTER = type { i32, i32 }
+ %DENSITY_FILE = type { i32, %DENSITY_FILE_DATA* }
+ %DENSITY_FILE_DATA = type { i32, i8*, i32, i32, i32, i8*** }
+ %DESTROY_METHOD = type void (%OBJECT*)*
+ %FILE = type { i32, i8*, i8*, i8, i8, i32, i32, i32 }
+ %FILE_HANDLE = type { i8*, i32, i32, i32, i32, i8*, %FILE*, i32, i32 (%FILE_HANDLE*, i8*, i32*, i32*, i32, i32)*, void (%FILE_HANDLE*, %COLOUR*, i32)*, i32 (%FILE_HANDLE*, %COLOUR*, i32*)*, void (%IMAGE*, i8*)*, void (%FILE_HANDLE*)* }
+ %FINISH = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, %BBOX_VECT, %BBOX_VECT }
+ %FOG = type { i32, double, double, double, %COLOUR, %VECTOR, %TURB*, float, %FOG* }
+ %FRAME = type { %CAMERA*, i32, i32, i32, %LIGHT_SOURCE*, %OBJECT*, double, double, %COLOUR, %COLOUR, %COLOUR, %IMEDIA*, %FOG*, %RAINBOW*, %SKYSPHERE* }
+ %FRAMESEQ = type { i32, double, i32, i32, double, i32, i32, double, i32, double, i32, double, i32, i32 }
+ %IMAGE = type { i32, i32, i32, i32, i32, i16, i16, %VECTOR, float, float, i32, i32, i16, %IMAGE_COLOUR*, { %IMAGE_LINE*, i8** } }
+ %IMAGE_COLOUR = type { i16, i16, i16, i16, i16 }
+ %IMAGE_LINE = type { i8*, i8*, i8*, i8* }
+ %IMEDIA = type { i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, %COLOUR, %COLOUR, %COLOUR, %COLOUR, double, double, double, double*, %PIGMENT*, %IMEDIA* }
+ %INSIDE_METHOD = type i32 (double*, %OBJECT*)*
+ %INTERIOR = type { i32, i32, float, float, float, float, float, %IMEDIA* }
+ %INTERSECTION = type { double, %VECTOR, %VECTOR, %OBJECT*, i32, i32, double, double, i8* }
+ %INVERT_METHOD = type void (%OBJECT*)*
+ %ISTACK = type { %ISTACK*, %INTERSECTION*, i32 }
+ %LIGHT_SOURCE = type { %METHODS*, i32, %OBJECT*, %TEXTURE*, %INTERIOR*, %OBJECT*, %OBJECT*, %BBOX, i32, %OBJECT*, %COLOUR, %VECTOR, %VECTOR, %VECTOR, %VECTOR, %VECTOR, double, double, double, double, double, %LIGHT_SOURCE*, i8, i8, i8, i8, i32, i32, i32, i32, i32, %COLOUR**, %OBJECT*, [6 x %PROJECT_TREE_NODE*] }
+ %MATRIX = type [4 x %VECTOR_4D]
+ %METHODS = type { %ALL_INTERSECTIONS_METHOD, %INSIDE_METHOD, %NORMAL_METHOD, %COPY_METHOD, %ROTATE_METHOD, %ROTATE_METHOD, %ROTATE_METHOD, %TRANSFORM_METHOD, %DESTROY_METHOD, %DESTROY_METHOD }
+ %NORMAL_METHOD = type void (double*, %OBJECT*, %INTERSECTION*)*
+ %OBJECT = type { %METHODS*, i32, %OBJECT*, %TEXTURE*, %INTERIOR*, %OBJECT*, %OBJECT*, %BBOX, i32 }
+ %Opts = type { i32, i32, i8, i8, i8, i32, [150 x i8], [150 x i8], [150 x i8], [150 x i8], [150 x i8], double, double, i32, i32, double, double, i32, [25 x i8*], i32, i32, i32, double, double, i32, i32, double, double, double, i32, i32, i32, i32, i32, %FRAMESEQ, double, i32, double, double, double, double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [150 x i8], %SHELLDATA*, [150 x i8], i32, i32 }
+ %PIGMENT = type { i16, i16, i16, i32, float, float, float, %WARP*, %TPATTERN*, %BLEND_MAP*, { %DENSITY_FILE*, %IMAGE*, %VECTOR, float, i16, i16, i16, { float, %VECTOR }, %complex.float }, %COLOUR }
+ %PRIORITY_QUEUE = type { i32, i32, %QELEM* }
+ %PROJECT = type { i32, i32, i32, i32 }
+ %PROJECT_QUEUE = type { i32, i32, %PROJECT_TREE_NODE** }
+ %PROJECT_TREE_NODE = type { i16, %BBOX_TREE*, %PROJECT, i16, %PROJECT_TREE_NODE** }
+ %QELEM = type { double, %BBOX_TREE* }
+ %RAINBOW = type { double, double, double, double, double, double, double, %VECTOR, %VECTOR, %VECTOR, %PIGMENT*, %RAINBOW* }
+ %RAY = type { %VECTOR, %VECTOR, i32, [100 x %INTERIOR*] }
+ %RAYINFO = type { %VECTOR, %VECTOR, %VECTORI, %VECTORI }
+ %RGB = type [3 x float]
+ %ROTATE_METHOD = type void (%OBJECT*, double*, %TRANSFORM*)*
+ %SCALE_METHOD = type void (%OBJECT*, double*, %TRANSFORM*)*
+ %SHELLDATA = type { i32, i32, [250 x i8] }
+ %SKYSPHERE = type { i32, %PIGMENT**, %TRANSFORM* }
+ %SNGL_VECT = type [3 x float]
+ %TEXTURE = type { i16, i16, i16, i32, float, float, float, %WARP*, %TPATTERN*, %BLEND_MAP*, { %DENSITY_FILE*, %IMAGE*, %VECTOR, float, i16, i16, i16, { float, %VECTOR }, %complex.float }, %TEXTURE*, %PIGMENT*, %TNORMAL*, %FINISH*, %TEXTURE*, i32 }
+ %TNORMAL = type { i16, i16, i16, i32, float, float, float, %WARP*, %TPATTERN*, %BLEND_MAP*, { %DENSITY_FILE*, %IMAGE*, %VECTOR, float, i16, i16, i16, { float, %VECTOR }, %complex.float }, float }
+ %TPATTERN = type { i16, i16, i16, i32, float, float, float, %WARP*, %TPATTERN*, %BLEND_MAP*, { %DENSITY_FILE*, %IMAGE*, %VECTOR, float, i16, i16, i16, { float, %VECTOR }, %complex.float } }
+ %TRANSFORM = type { %MATRIX, %MATRIX }
+ %TRANSFORM_METHOD = type void (%OBJECT*, %TRANSFORM*)*
+ %TRANSLATE_METHOD = type void (%OBJECT*, double*, %TRANSFORM*)*
+ %TURB = type { i16, %WARP*, %VECTOR, i32, float, float }
+ %UV_VECT = type [2 x double]
+ %VECTOR = type [3 x double]
+ %VECTORI = type [3 x i32]
+ %VECTOR_4D = type [4 x double]
+ %WARP = type { i16, %WARP* }
+ %__FILE = type { i32, i8*, i8*, i8, i8, i32, i32, i32 }
+ %_h_val = type { [2 x i32], double }
+ %complex.float = type { float, float }
diff --git a/test/Assembler/2002-07-14-InternalLossage.ll b/test/Assembler/2002-07-14-InternalLossage.ll
new file mode 100644
index 000000000000..f93f1c4a5fb0
--- /dev/null
+++ b/test/Assembler/2002-07-14-InternalLossage.ll
@@ -0,0 +1,9 @@
+; Test to make sure that the 'internal' tag is not lost!
+;
+; RUN: llvm-as < %s | llvm-dis | grep internal
+
+declare void @foo()
+
+define internal void @foo() {
+ ret void
+}
diff --git a/test/Assembler/2002-07-14-OpaqueType.ll b/test/Assembler/2002-07-14-OpaqueType.ll
new file mode 100644
index 000000000000..662fb0f31c1d
--- /dev/null
+++ b/test/Assembler/2002-07-14-OpaqueType.ll
@@ -0,0 +1,10 @@
+; Test that opaque types are preserved correctly
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis
+;
+
+%Ty = type opaque
+
+define %Ty* @func() {
+ ret %Ty* null
+}
+
diff --git a/test/Assembler/2002-07-25-ParserAssertionFailure.ll b/test/Assembler/2002-07-25-ParserAssertionFailure.ll
new file mode 100644
index 000000000000..29c7c02ff850
--- /dev/null
+++ b/test/Assembler/2002-07-25-ParserAssertionFailure.ll
@@ -0,0 +1,13 @@
+; 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 {'@foo' defined with}
+
+%ty = type void (i32)
+
+declare %ty* @foo()
+
+define void @test() {
+ call %ty* @foo( ) ; <%ty*>:0 [#uses=0]
+ ret void
+}
+
diff --git a/test/Assembler/2002-07-25-QuoteInString.ll b/test/Assembler/2002-07-25-QuoteInString.ll
new file mode 100644
index 000000000000..facc5bdae62e
--- /dev/null
+++ b/test/Assembler/2002-07-25-QuoteInString.ll
@@ -0,0 +1,5 @@
+; Test double quotes in strings work correctly!
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis
+;
+@str = internal global [6 x i8] c"\22foo\22\00" ; <[6 x i8]*> [#uses=0]
+
diff --git a/test/Assembler/2002-07-25-ReturnPtrFunction.ll b/test/Assembler/2002-07-25-ReturnPtrFunction.ll
new file mode 100644
index 000000000000..515d105c14c6
--- /dev/null
+++ b/test/Assembler/2002-07-25-ReturnPtrFunction.ll
@@ -0,0 +1,15 @@
+; Test that returning a pointer to a function causes the disassembler to print
+; the right thing.
+;
+; RUN: llvm-as < %s | llvm-dis | llvm-as
+
+%ty = type void (i32)
+
+declare %ty* @foo()
+
+define void @test() {
+ call %ty* ()* @foo( ) ; <%ty*>:1 [#uses=0]
+ ret void
+}
+
+
diff --git a/test/Assembler/2002-07-31-SlashInString.ll b/test/Assembler/2002-07-31-SlashInString.ll
new file mode 100644
index 000000000000..ff48258870dd
--- /dev/null
+++ b/test/Assembler/2002-07-31-SlashInString.ll
@@ -0,0 +1,5 @@
+; RUN: llvm-as < %s | llvm-dis | llvm-as
+
+; Make sure that \\ works in a string initializer
+@Slashtest = internal global [8 x i8] c"\5Cbegin{\00"
+
diff --git a/test/Assembler/2002-08-15-CastAmbiguity.ll b/test/Assembler/2002-08-15-CastAmbiguity.ll
new file mode 100644
index 000000000000..c10f91103fdc
--- /dev/null
+++ b/test/Assembler/2002-08-15-CastAmbiguity.ll
@@ -0,0 +1,6 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+define void @test(i32 %X) {
+ call void @test( i32 6 )
+ ret void
+}
diff --git a/test/Assembler/2002-08-15-ConstantExprProblem.ll b/test/Assembler/2002-08-15-ConstantExprProblem.ll
new file mode 100644
index 000000000000..d02c26a80cdb
--- /dev/null
+++ b/test/Assembler/2002-08-15-ConstantExprProblem.ll
@@ -0,0 +1,16 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+@.LC0 = internal global [12 x i8] c"hello world\00" ; <[12 x i8]*> [#uses=1]
+
+define i8* @test() {
+; <label>:0
+ br label %BB1
+
+BB1: ; preds = %BB2, %0
+ %ret = phi i8* [ getelementptr ([12 x i8]* @.LC0, i64 0, i64 0), %0 ], [ null, %BB2 ] ; <i8*> [#uses=1]
+ ret i8* %ret
+
+BB2: ; No predecessors!
+ br label %BB1
+}
+
diff --git a/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll b/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll
new file mode 100644
index 000000000000..5252be266a16
--- /dev/null
+++ b/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+@.LC0 = internal global [12 x i8] c"hello world\00" ; <[12 x i8]*> [#uses=1]
+
+define i8* @test() {
+ ret i8* getelementptr ([12 x i8]* @.LC0, i64 0, i64 0)
+}
+
diff --git a/test/Assembler/2002-08-16-ConstExprInlined.ll b/test/Assembler/2002-08-16-ConstExprInlined.ll
new file mode 100644
index 000000000000..f233bacca46b
--- /dev/null
+++ b/test/Assembler/2002-08-16-ConstExprInlined.ll
@@ -0,0 +1,22 @@
+; In this testcase, the bytecode reader or writer is not correctly handling the
+; ConstExpr reference. Disassembling this program assembled yields invalid
+; assembly (because there are placeholders still around), which the assembler
+; dies on.
+
+; There are two things that need to be fixed here. Obviously assembling and
+; disassembling this would be good, but in addition to that, the bytecode
+; reader should NEVER produce a program "successfully" with placeholders still
+; around!
+;
+; RUN: llvm-as < %s | llvm-dis | llvm-as
+
+@.LC0 = internal global [4 x i8] c"foo\00" ; <[4 x i8]*> [#uses=1]
+@X = global i8* null ; <i8**> [#uses=0]
+
+declare i32 @puts(i8*)
+
+define void @main() {
+bb1:
+ %reg211 = call i32 @puts( i8* getelementptr ([4 x i8]* @.LC0, i64 0, i64 0) ) ; <i32> [#uses=0]
+ ret void
+}
diff --git a/test/Assembler/2002-08-19-BytecodeReader.ll b/test/Assembler/2002-08-19-BytecodeReader.ll
new file mode 100644
index 000000000000..e42cda0baa07
--- /dev/null
+++ b/test/Assembler/2002-08-19-BytecodeReader.ll
@@ -0,0 +1,17 @@
+; Testcase that seems to break the bytecode reader. This comes from the
+; "crafty" spec benchmark.
+;
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | llvm-as
+
+%CHESS_POSITION = type { i32, i32 }
+@pawn_probes = external global i32 ; <i32*> [#uses=0]
+@pawn_hash_mask = external global i32 ; <i32*> [#uses=0]
+@search = external global %CHESS_POSITION ; <%CHESS_POSITION*> [#uses=2]
+
+define void @Evaluate() {
+ %reg1321 = getelementptr %CHESS_POSITION* @search, i64 0, i32 1 ; <i32*> [#uses=1]
+ %reg114 = load i32* %reg1321 ; <i32> [#uses=0]
+ %reg1801 = getelementptr %CHESS_POSITION* @search, i64 0, i32 0 ; <i32*> [#uses=1]
+ %reg182 = load i32* %reg1801 ; <i32> [#uses=0]
+ ret void
+}
diff --git a/test/Assembler/2002-08-22-DominanceProblem.ll b/test/Assembler/2002-08-22-DominanceProblem.ll
new file mode 100644
index 000000000000..a841dfa83855
--- /dev/null
+++ b/test/Assembler/2002-08-22-DominanceProblem.ll
@@ -0,0 +1,17 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+; Dominance relationships is not calculated correctly for unreachable blocks,
+; which causes the verifier to barf on this input.
+
+define i32 @test(i1 %b) {
+BB0:
+ ret i32 7 ; Loop is unreachable
+
+Loop: ; preds = %L2, %Loop
+ %B = phi i32 [ %B, %L2 ], [ %B, %Loop ] ;PHI has same value always.
+ br i1 %b, label %L2, label %Loop
+
+L2: ; preds = %Loop
+ br label %Loop
+}
+
diff --git a/test/Assembler/2002-10-08-LargeArrayPerformance.ll b/test/Assembler/2002-10-08-LargeArrayPerformance.ll
new file mode 100644
index 000000000000..2c4cba412b1e
--- /dev/null
+++ b/test/Assembler/2002-10-08-LargeArrayPerformance.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as %s -o /dev/null -f
+; This testcase comes from the following really simple c file:
+;; int foo[30000]
+;;; We should not be soo slow for such a simple case!
+
+@foo = global [30000 x i32] zeroinitializer ; <[30000 x i32]*> [#uses=0]
+
+declare void @__main()
diff --git a/test/Assembler/2002-10-13-ConstantEncodingProblem.ll b/test/Assembler/2002-10-13-ConstantEncodingProblem.ll
new file mode 100644
index 000000000000..bf3a52154342
--- /dev/null
+++ b/test/Assembler/2002-10-13-ConstantEncodingProblem.ll
@@ -0,0 +1,5 @@
+; RUN: llvm-as < %s | llvm-dis
+
+%Domain = type { %Domain**, %Domain* }
+@D = global %Domain zeroinitializer ; <%Domain*> [#uses=0]
+
diff --git a/test/Assembler/2002-10-15-NameClash.ll b/test/Assembler/2002-10-15-NameClash.ll
new file mode 100644
index 000000000000..8ba5ed2507c1
--- /dev/null
+++ b/test/Assembler/2002-10-15-NameClash.ll
@@ -0,0 +1,7 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+declare i32 @"ArrayRef"([100 x i32] * %Array)
+
+define i32 @"ArrayRef"([100 x i32] * %Array) {
+ ret i32 0
+}
diff --git a/test/Assembler/2002-12-15-GlobalResolve.ll b/test/Assembler/2002-12-15-GlobalResolve.ll
new file mode 100644
index 000000000000..da049c4f4320
--- /dev/null
+++ b/test/Assembler/2002-12-15-GlobalResolve.ll
@@ -0,0 +1,7 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+@X = external global i32*
+@X1 = external global %T*
+@X2 = external global i32*
+
+%T = type i32
diff --git a/test/Assembler/2003-01-30-UnsignedString.ll b/test/Assembler/2003-01-30-UnsignedString.ll
new file mode 100644
index 000000000000..5eaa9c2c8389
--- /dev/null
+++ b/test/Assembler/2003-01-30-UnsignedString.ll
@@ -0,0 +1,4 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+@spell_order = global [4 x i8] c"\FF\00\F7\00"
+
diff --git a/test/Assembler/2003-04-15-ConstantInitAssertion.ll b/test/Assembler/2003-04-15-ConstantInitAssertion.ll
new file mode 100644
index 000000000000..e0121688dc3f
--- /dev/null
+++ b/test/Assembler/2003-04-15-ConstantInitAssertion.ll
@@ -0,0 +1,4 @@
+; 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-04-25-UnresolvedGlobalReference.ll b/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll
new file mode 100644
index 000000000000..608eb6ae343c
--- /dev/null
+++ b/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll
@@ -0,0 +1,7 @@
+; RUN: llvm-as %s -o /dev/null -f
+; There should be absolutely no problem with this testcase.
+
+define i32 @test(i32 %arg1, i32 %arg2) {
+ ret i32 ptrtoint (i32 (i32, i32)* @test to i32)
+}
+
diff --git a/test/Assembler/2003-05-03-BytecodeReaderProblem.ll b/test/Assembler/2003-05-03-BytecodeReaderProblem.ll
new file mode 100644
index 000000000000..f4a691160518
--- /dev/null
+++ b/test/Assembler/2003-05-03-BytecodeReaderProblem.ll
@@ -0,0 +1,6 @@
+; RUN: llvm-as < %s | llvm-dis
+
+define void @test() {
+ %tmp.123 = trunc i64 0 to i32 ; <i32> [#uses=0]
+ ret void
+}
diff --git a/test/Assembler/2003-05-12-MinIntProblem.ll b/test/Assembler/2003-05-12-MinIntProblem.ll
new file mode 100644
index 000000000000..ebe169013b4c
--- /dev/null
+++ b/test/Assembler/2003-05-12-MinIntProblem.ll
@@ -0,0 +1,5 @@
+; RUN: llvm-as < %s | llvm-dis | grep -- -2147483648
+
+define i32 @foo() {
+ ret i32 -2147483648
+}
diff --git a/test/Assembler/2003-05-15-AssemblerProblem.ll b/test/Assembler/2003-05-15-AssemblerProblem.ll
new file mode 100644
index 000000000000..17967a936506
--- /dev/null
+++ b/test/Assembler/2003-05-15-AssemblerProblem.ll
@@ -0,0 +1,14 @@
+; This bug was caused by two CPR's existing for the same global variable,
+; colliding in the Module level CPR map.
+; RUN: llvm-as %s -o /dev/null -f
+
+define void @test() {
+ call void (...)* bitcast (void (i16*, i32)* @AddString to void (...)*)( i16* null, i32 0 )
+ ret void
+}
+
+define void @AddString(i16* %tmp.124, i32 %tmp.127) {
+ call void (...)* bitcast (void (i16*, i32)* @AddString to void (...)*)( i16* %tmp.124, i32 %tmp.127 )
+ ret void
+}
+
diff --git a/test/Assembler/2003-05-15-SwitchBug.ll b/test/Assembler/2003-05-15-SwitchBug.ll
new file mode 100644
index 000000000000..af42020ca167
--- /dev/null
+++ b/test/Assembler/2003-05-15-SwitchBug.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+; Check minimal switch statement
+
+define void @test(i32 %X) {
+ switch i32 %X, label %dest [
+ ]
+
+dest: ; preds = %0
+ ret void
+}
diff --git a/test/Assembler/2003-05-21-ConstantShiftExpr.ll b/test/Assembler/2003-05-21-ConstantShiftExpr.ll
new file mode 100644
index 000000000000..667bc9b93320
--- /dev/null
+++ b/test/Assembler/2003-05-21-ConstantShiftExpr.ll
@@ -0,0 +1,4 @@
+; RUN: llvm-as %s -o /dev/null -f
+; Test that shift instructions can be used in constant expressions.
+
+global i32 3670016
diff --git a/test/Assembler/2003-05-21-EmptyStructTest.ll b/test/Assembler/2003-05-21-EmptyStructTest.ll
new file mode 100644
index 000000000000..6925d2693250
--- /dev/null
+++ b/test/Assembler/2003-05-21-EmptyStructTest.ll
@@ -0,0 +1,6 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+; The old C front-end never generated empty structures, now the new one
+; can. For some reason we never handled them in the parser. Weird.
+
+@X = global { } zeroinitializer
diff --git a/test/Assembler/2003-05-21-MalformedShiftCrash.ll b/test/Assembler/2003-05-21-MalformedShiftCrash.ll
new file mode 100644
index 000000000000..c661f7c0771e
--- /dev/null
+++ b/test/Assembler/2003-05-21-MalformedShiftCrash.ll
@@ -0,0 +1,4 @@
+; Found by inspection of the code
+; 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
new file mode 100644
index 000000000000..1efb57704ec2
--- /dev/null
+++ b/test/Assembler/2003-05-21-MalformedStructCrash.ll
@@ -0,0 +1,4 @@
+; Found by inspection of the code
+; 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-06-17-InvokeDisassemble.ll b/test/Assembler/2003-06-17-InvokeDisassemble.ll
new file mode 100644
index 000000000000..922a996cd7dd
--- /dev/null
+++ b/test/Assembler/2003-06-17-InvokeDisassemble.ll
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | llvm-dis
+
+define void @test() {
+ invoke void @test( )
+ to label %Next unwind label %Next
+
+Next: ; preds = %0, %0
+ ret void
+}
diff --git a/test/Assembler/2003-06-30-RecursiveTypeProblem.ll b/test/Assembler/2003-06-30-RecursiveTypeProblem.ll
new file mode 100644
index 000000000000..33f63a621711
--- /dev/null
+++ b/test/Assembler/2003-06-30-RecursiveTypeProblem.ll
@@ -0,0 +1,3 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+%MidFnTy = type void (%MidFnTy*)
diff --git a/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll b/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll
new file mode 100644
index 000000000000..6f31f16778f6
--- /dev/null
+++ b/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll
@@ -0,0 +1,16 @@
+; RUN: llvm-as < %s | opt -instcombine -simplifycfg | llvm-dis | not grep br
+
+@.str_1 = internal constant [6 x i8] c"_Bool\00" ; <[6 x i8]*> [#uses=2]
+
+define i32 @test() {
+ %tmp.54 = load i8* getelementptr ([6 x i8]* @.str_1, i64 0, i64 1) ; <i8> [#uses=1]
+ %tmp.55 = icmp ne i8 %tmp.54, 66 ; <i1> [#uses=1]
+ br i1 %tmp.55, label %then.7, label %endif.7
+
+then.7: ; preds = %then.7, %0
+ br label %then.7
+
+endif.7: ; preds = %0
+ ret i32 0
+}
+
diff --git a/test/Assembler/2003-08-21-ConstantExprCast-Fold.ll b/test/Assembler/2003-08-21-ConstantExprCast-Fold.ll
new file mode 100644
index 000000000000..b76f7745849e
--- /dev/null
+++ b/test/Assembler/2003-08-21-ConstantExprCast-Fold.ll
@@ -0,0 +1,4 @@
+; RUN: llvm-as < %s | llvm-dis | not grep getelementptr
+
+@A = external global { float } ; <{ float }*> [#uses=2]
+global i32* bitcast ({ float }* @A to i32*) ; <i32**>:0 [#uses=0]
diff --git a/test/Assembler/2003-10-04-NotMergingGlobalConstants.ll b/test/Assembler/2003-10-04-NotMergingGlobalConstants.ll
new file mode 100644
index 000000000000..10a0280e9060
--- /dev/null
+++ b/test/Assembler/2003-10-04-NotMergingGlobalConstants.ll
@@ -0,0 +1,6 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+%T = type i32
+@X = global i32* null ; <i32**> [#uses=0]
+@Y = global i32* null ; <i32**> [#uses=0]
+
diff --git a/test/Assembler/2003-11-05-ConstantExprShift.ll b/test/Assembler/2003-11-05-ConstantExprShift.ll
new file mode 100644
index 000000000000..86b093e35129
--- /dev/null
+++ b/test/Assembler/2003-11-05-ConstantExprShift.ll
@@ -0,0 +1,5 @@
+; RUN: llvm-as < %s | llvm-dis
+
+define i32 @test() {
+ ret i32 ashr (i32 ptrtoint (i32 ()* @test to i32), i32 2)
+}
diff --git a/test/Assembler/2003-11-11-ImplicitRename.ll b/test/Assembler/2003-11-11-ImplicitRename.ll
new file mode 100644
index 000000000000..7bfd3c14bf19
--- /dev/null
+++ b/test/Assembler/2003-11-11-ImplicitRename.ll
@@ -0,0 +1,8 @@
+; RUN: not llvm-as < %s >& /dev/null
+
+void %test() {
+ %X = add int 0, 1
+ %X = add int 1, 2
+ ret void
+}
+
diff --git a/test/Assembler/2003-11-12-ConstantExprCast.ll b/test/Assembler/2003-11-12-ConstantExprCast.ll
new file mode 100644
index 000000000000..149fef2276e4
--- /dev/null
+++ b/test/Assembler/2003-11-12-ConstantExprCast.ll
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llvm-dis | not grep { bitcast (}
+
+@.Base64_1 = external constant [4 x i8] ; <[4 x i8]*> [#uses=1]
+
+define i8 @test(i8 %Y) {
+ %X = bitcast i8 %Y to i8 ; <i8> [#uses=1]
+ %tmp.13 = add i8 %X, sub (i8 0, i8 ptrtoint ([4 x i8]* @.Base64_1 to i8)) ; <i8> [#uses=1]
+ ret i8 %tmp.13
+}
+
diff --git a/test/Assembler/2003-11-24-SymbolTableCrash.ll b/test/Assembler/2003-11-24-SymbolTableCrash.ll
new file mode 100644
index 000000000000..041b0d94c413
--- /dev/null
+++ b/test/Assembler/2003-11-24-SymbolTableCrash.ll
@@ -0,0 +1,10 @@
+; RUN: not llvm-as < %s |& grep {multiple definition}
+
+define void @test() {
+ %tmp.1 = add i32 0, 1
+ br label %return
+return:
+ %tmp.1 = add i32 0, 1
+ ret void
+}
+
diff --git a/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll b/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll
new file mode 100644
index 000000000000..bdb4d546854c
--- /dev/null
+++ b/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll
@@ -0,0 +1,55 @@
+; 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 {
+ i32 (i8*, i8**, i32, i32, {
+ %struct.Grammar*, void (\4, %struct.d_loc_t*, i8**)*, %struct.D_Scope*,
+ void (\4)*, { i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*,
+ void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
+ %struct.ParseNode_User }* (\4, i32, { i32, %struct.d_loc_t, i8*, i8*,
+ %struct.D_Scope*, void (\9, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
+ %struct.ParseNode_User }**)*,
+ void ({ i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*,
+ void (\8, %struct.d_loc_t*, i8**)*,
+ %struct.Grammar*, %struct.ParseNode_User }*)*,
+ %struct.d_loc_t, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32,
+ i32 }*)*,
+ i32 (i8*, i8**, i32, i32, { %struct.Grammar*,
+ void (\4, %struct.d_loc_t*, i8**)*, %struct.D_Scope*, void (\4)*, {
+ i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*,
+ void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
+ %struct.ParseNode_User }* (\4, i32, { i32, %struct.d_loc_t, i8*, i8*,
+ %struct.D_Scope*, void (\9, %struct.d_loc_t*, i8**)*,
+ %struct.Grammar*, %struct.ParseNode_User }**)*,
+ void ({ i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*,
+ void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
+ %struct.ParseNode_User }*)*, %struct.d_loc_t, i32, i32, i32, i32,
+ i32, i32, i32, i32, i32, i32, i32, i32 }*)** }
+
+ { i32 (i8*, i8**, i32, i32, {
+ %struct.Grammar*, void (\4, %struct.d_loc_t*, i8**)*,
+ %struct.D_Scope*, void (\4)*, {
+ i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*,
+ void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
+ %struct.ParseNode_User
+ }* (\4, i32, { i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*,
+ void (\9, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
+ %struct.ParseNode_User }**)*,
+ void ({ i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*,
+ void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
+ %struct.ParseNode_User }*)*,
+ %struct.d_loc_t, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32,
+ i32, i32 }*)* null,
+ i32 (i8*, i8**, i32, i32, {
+ %struct.Grammar*, void (\4, %struct.d_loc_t*, i8**)*,
+ %struct.D_Scope*, void (\4)*, { i32, %struct.d_loc_t, i8*, i8*,
+ %struct.D_Scope*, void (\8, %struct.d_loc_t*, i8**)*,
+ %struct.Grammar*, %struct.ParseNode_User }* (\4, i32, { i32,
+ %struct.d_loc_t, i8*, i8*, %struct.D_Scope*,
+ void (\9, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
+ %struct.ParseNode_User }**)*,
+ void ({ i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*,
+ void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
+ %struct.ParseNode_User }*)*, %struct.d_loc_t, i32, i32, i32,
+ i32, i32, i32, i32, i32, i32, i32, i32, i32 }*)** null
+ }
diff --git a/test/Assembler/2004-01-11-getelementptrfolding.ll b/test/Assembler/2004-01-11-getelementptrfolding.ll
new file mode 100644
index 000000000000..c22aede5df4b
--- /dev/null
+++ b/test/Assembler/2004-01-11-getelementptrfolding.ll
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | llvm-dis | \
+; RUN: not grep {getelementptr.*getelementptr}
+
+%struct.TTriangleItem = type { i8*, i8*, [3 x %struct.TUVVertex] }
+%struct.TUVVertex = type { i16, i16, i16, i16 }
+@data_triangleItems = internal constant [2908 x %struct.TTriangleItem] zeroinitializer; <[2908 x %struct.TTriangleItem]*> [#uses=2]
+
+define void @foo() {
+ store i16 0, i16* getelementptr ([2908 x %struct.TTriangleItem]* @data_triangleItems, i64 0, i64 0, i32 2, i64 0, i32 0)
+ ret void
+}
+
diff --git a/test/Assembler/2004-01-20-MaxLongLong.ll b/test/Assembler/2004-01-20-MaxLongLong.ll
new file mode 100644
index 000000000000..8af5332ccc67
--- /dev/null
+++ b/test/Assembler/2004-01-20-MaxLongLong.ll
@@ -0,0 +1,4 @@
+; RUN: llvm-as < %s | llvm-dis | grep 9223372036854775808
+
+global i64 -9223372036854775808
+
diff --git a/test/Assembler/2004-02-01-NegativeZero.ll b/test/Assembler/2004-02-01-NegativeZero.ll
new file mode 100644
index 000000000000..b28930f2852c
--- /dev/null
+++ b/test/Assembler/2004-02-01-NegativeZero.ll
@@ -0,0 +1,5 @@
+; RUN: llvm-as < %s | llvm-dis | grep -- -0.0
+
+global double 0x8000000000000000
+global float -0.0
+
diff --git a/test/Assembler/2004-02-27-SelfUseAssertError.ll b/test/Assembler/2004-02-27-SelfUseAssertError.ll
new file mode 100644
index 000000000000..ff4c0b43e48a
--- /dev/null
+++ b/test/Assembler/2004-02-27-SelfUseAssertError.ll
@@ -0,0 +1,25 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+; %inc2 uses it's own value, but that's ok, as it's unreachable!
+
+define void @test() {
+entry:
+ ret void
+
+no_exit.2: ; preds = %endif.6
+ %tmp.103 = fcmp olt double 0.000000e+00, 0.000000e+00 ; <i1> [#uses=1]
+ br i1 %tmp.103, label %endif.6, label %else.0
+
+else.0: ; preds = %no_exit.2
+ store i16 0, i16* null
+ br label %endif.6
+
+endif.6: ; preds = %else.0, %no_exit.2
+ %inc.2 = add i32 %inc.2, 1 ; <i32> [#uses=2]
+ %tmp.96 = icmp slt i32 %inc.2, 0 ; <i1> [#uses=1]
+ br i1 %tmp.96, label %no_exit.2, label %UnifiedReturnBlock1
+
+UnifiedReturnBlock1: ; preds = %endif.6
+ ret void
+}
+
diff --git a/test/Assembler/2004-03-07-FunctionAddressAlignment.ll b/test/Assembler/2004-03-07-FunctionAddressAlignment.ll
new file mode 100644
index 000000000000..e3bf0bb8ac78
--- /dev/null
+++ b/test/Assembler/2004-03-07-FunctionAddressAlignment.ll
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | llvm-dis | not grep ptrtoint
+; All of these should be eliminable
+
+
+define i32 @foo() {
+ ret i32 and (i32 ptrtoint (i32()* @foo to i32), i32 1)
+}
+
+define i32 @foo2() {
+ ret i32 and (i32 1, i32 ptrtoint (i32()* @foo2 to i32))
+}
+
+define i1 @foo3() {
+ ret i1 icmp ne (i1()* @foo3, i1()* null)
+}
diff --git a/test/Assembler/2004-03-30-UnclosedFunctionCrash.ll b/test/Assembler/2004-03-30-UnclosedFunctionCrash.ll
new file mode 100644
index 000000000000..775b7558f3ce
--- /dev/null
+++ b/test/Assembler/2004-03-30-UnclosedFunctionCrash.ll
@@ -0,0 +1,3 @@
+; RUN: not llvm-as %s |& grep {found end of file when expecting more instructions}
+
+define void @foo() {
diff --git a/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll b/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll
new file mode 100644
index 000000000000..c9363dbcdca9
--- /dev/null
+++ b/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll
@@ -0,0 +1,10 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+define i32* @t1({ float, i32 }* %X) {
+ %W = getelementptr { float, i32 }* %X, i32 20, i32 1 ; <i32*> [#uses=0]
+ %X.upgrd.1 = getelementptr { float, i32 }* %X, i64 20, i32 1 ; <i32*> [#uses=0]
+ %Y = getelementptr { float, i32 }* %X, i64 20, i32 1 ; <i32*> [#uses=1]
+ %Z = getelementptr { float, i32 }* %X, i64 20, i32 1 ; <i32*> [#uses=0]
+ ret i32* %Y
+}
+
diff --git a/test/Assembler/2004-06-07-VerifierBug.ll b/test/Assembler/2004-06-07-VerifierBug.ll
new file mode 100644
index 000000000000..07d2383ccff9
--- /dev/null
+++ b/test/Assembler/2004-06-07-VerifierBug.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s > /dev/null
+
+define void @t() {
+entry:
+ ret void
+
+loop: ; preds = %loop
+ %tmp.4.i9 = getelementptr i32* null, i32 %tmp.5.i10 ; <i32*> [#uses=1]
+ %tmp.5.i10 = load i32* %tmp.4.i9 ; <i32> [#uses=1]
+ br label %loop
+}
diff --git a/test/Assembler/2004-10-22-BCWriterUndefBug.ll b/test/Assembler/2004-10-22-BCWriterUndefBug.ll
new file mode 100644
index 000000000000..4b2ebeee9342
--- /dev/null
+++ b/test/Assembler/2004-10-22-BCWriterUndefBug.ll
@@ -0,0 +1,5 @@
+;; The bytecode writer was trying to treat undef values as ConstantArray's when
+;; they looked like strings.
+;; RUN: llvm-as %s -o /dev/null -f
+@G = internal global [8 x i8] undef
+
diff --git a/test/Assembler/2004-11-28-InvalidTypeCrash.ll b/test/Assembler/2004-11-28-InvalidTypeCrash.ll
new file mode 100644
index 000000000000..6f264393a598
--- /dev/null
+++ b/test/Assembler/2004-11-28-InvalidTypeCrash.ll
@@ -0,0 +1,4 @@
+; Test for PR463. This program is erroneous, but should not crash llvm-as.
+; 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/2005-01-03-FPConstantDisassembly.ll b/test/Assembler/2005-01-03-FPConstantDisassembly.ll
new file mode 100644
index 000000000000..aaa776f51b81
--- /dev/null
+++ b/test/Assembler/2005-01-03-FPConstantDisassembly.ll
@@ -0,0 +1,6 @@
+; RUN: llvm-as < %s | llvm-dis | grep 1.0
+
+define double @test() {
+ ret double 1.0 ;; This should not require hex notation
+}
+
diff --git a/test/Assembler/2005-01-31-CallingAggregateFunction.ll b/test/Assembler/2005-01-31-CallingAggregateFunction.ll
new file mode 100644
index 000000000000..14045138f811
--- /dev/null
+++ b/test/Assembler/2005-01-31-CallingAggregateFunction.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+define void @test() {
+ call {i32} @foo()
+ ret void
+}
+
+declare {i32 } @foo()
diff --git a/test/Assembler/2005-02-09-AsmWriterStoreBug.ll b/test/Assembler/2005-02-09-AsmWriterStoreBug.ll
new file mode 100644
index 000000000000..4ec17966e792
--- /dev/null
+++ b/test/Assembler/2005-02-09-AsmWriterStoreBug.ll
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llvm-dis | llvm-as
+
+; Ensure that the asm writer emits types before both operands of the
+; store, even though they can be the same.
+
+%RecTy = type %RecTy*
+
+define void @foo() {
+ %A = malloc %RecTy ; <%RecTy> [#uses=1]
+ %B = malloc %RecTy ; <%RecTy> [#uses=1]
+ store %RecTy %B, %RecTy %A
+ ret void
+}
+
diff --git a/test/Assembler/2005-05-05-OpaqueUndefValues.ll b/test/Assembler/2005-05-05-OpaqueUndefValues.ll
new file mode 100644
index 000000000000..8cd1419b08b3
--- /dev/null
+++ b/test/Assembler/2005-05-05-OpaqueUndefValues.ll
@@ -0,0 +1,4 @@
+; RUN: llvm-as < %s | llvm-dis | llvm-as > /dev/null
+
+%t = type opaque
+@x = global %t undef
diff --git a/test/Assembler/2005-12-21-ZeroInitVector.ll b/test/Assembler/2005-12-21-ZeroInitVector.ll
new file mode 100644
index 000000000000..d3a692c60c9e
--- /dev/null
+++ b/test/Assembler/2005-12-21-ZeroInitVector.ll
@@ -0,0 +1,6 @@
+; RUN: llvm-as < %s > /dev/null
+
+define <4 x i32> @foo() {
+ ret <4 x i32> zeroinitializer
+}
+
diff --git a/test/Assembler/2006-05-26-VarargsCallEncode.ll b/test/Assembler/2006-05-26-VarargsCallEncode.ll
new file mode 100644
index 000000000000..6dc60c3f79d9
--- /dev/null
+++ b/test/Assembler/2006-05-26-VarargsCallEncode.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | llvm-dis | grep {tail call void.*sret null}
+
+declare void @foo({ }* sret , ...)
+
+define void @bar() {
+ tail call void ({ }* sret , ...)* @foo( { }* null sret , i32 0 )
+ ret void
+}
diff --git a/test/Assembler/2006-09-28-CrashOnInvalid.ll b/test/Assembler/2006-09-28-CrashOnInvalid.ll
new file mode 100644
index 000000000000..a203c6ad034d
--- /dev/null
+++ b/test/Assembler/2006-09-28-CrashOnInvalid.ll
@@ -0,0 +1,8 @@
+; 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 {floating point constant invalid for type}
+
+define void @test() {
+ add i32 1, 2.0
+ ret void
+}
diff --git a/test/Assembler/2006-12-09-Cast-To-Bool.ll b/test/Assembler/2006-12-09-Cast-To-Bool.ll
new file mode 100644
index 000000000000..a70262c802c1
--- /dev/null
+++ b/test/Assembler/2006-12-09-Cast-To-Bool.ll
@@ -0,0 +1,6 @@
+; RUN: llvm-as < %s | llvm-dis | grep bitcast
+
+define i1 @main(i32 %X) {
+ %res = bitcast i1 true to i1
+ ret i1 %res
+}
diff --git a/test/Assembler/2007-01-02-Undefined-Arg-Type.ll b/test/Assembler/2007-01-02-Undefined-Arg-Type.ll
new file mode 100644
index 000000000000..1962ae70c03d
--- /dev/null
+++ b/test/Assembler/2007-01-02-Undefined-Arg-Type.ll
@@ -0,0 +1,9 @@
+; The assembler should catch an undefined argument type .
+; RUN: not llvm-as %s -o /dev/null -f |& grep {use of undefined type named 'typedef.bc_struct'}
+
+; %typedef.bc_struct = type opaque
+
+
+define i1 @someFunc(i32* %tmp.71.reload, %typedef.bc_struct* %n1) {
+ ret i1 true
+}
diff --git a/test/Assembler/2007-01-05-Cmp-ConstExpr.ll b/test/Assembler/2007-01-05-Cmp-ConstExpr.ll
new file mode 100644
index 000000000000..8c25989d21a3
--- /dev/null
+++ b/test/Assembler/2007-01-05-Cmp-ConstExpr.ll
@@ -0,0 +1,18 @@
+; Test Case for PR1080
+; RUN: llvm-as %s -o /dev/null -f
+
+@str = internal constant [4 x i8] c"-ga\00" ; <[4 x i8]*> [#uses=2]
+
+define i32 @main(i32 %argc, i8** %argv) {
+entry:
+ %tmp65 = getelementptr i8** %argv, i32 1 ; <i8**> [#uses=1]
+ %tmp66 = load i8** %tmp65 ; <i8*> [#uses=0]
+ br i1 icmp ne (i32 sub (i32 ptrtoint (i8* getelementptr ([4 x i8]* @str, i32 0, i64 1) to i32), i32 ptrtoint ([4 x i8]* @str to i32)), i32 1), label %exit_1, label %exit_2
+
+exit_1: ; preds = %entry
+ ret i32 0
+
+exit_2: ; preds = %entry
+ ret i32 1
+}
+
diff --git a/test/Assembler/2007-01-16-CrashOnBadCast.ll b/test/Assembler/2007-01-16-CrashOnBadCast.ll
new file mode 100644
index 000000000000..33666b8cb2ce
--- /dev/null
+++ b/test/Assembler/2007-01-16-CrashOnBadCast.ll
@@ -0,0 +1,7 @@
+; PR1117
+; RUN: not llvm-as %s -o /dev/null -f |& grep {invalid cast opcode for cast from}
+
+define i8* @nada(i64 %X) {
+ %result = trunc i64 %X to i8*
+ ret i8* %result
+}
diff --git a/test/Assembler/2007-01-16-CrashOnBadCast2.ll b/test/Assembler/2007-01-16-CrashOnBadCast2.ll
new file mode 100644
index 000000000000..49c539f5024b
--- /dev/null
+++ b/test/Assembler/2007-01-16-CrashOnBadCast2.ll
@@ -0,0 +1,4 @@
+; PR1117
+; RUN: not llvm-as %s -o /dev/null -f |& grep {invalid cast opcode for cast from}
+
+@X = constant i8* trunc (i64 0 to i8*)
diff --git a/test/Assembler/2007-03-18-InvalidNumberedVar.ll b/test/Assembler/2007-03-18-InvalidNumberedVar.ll
new file mode 100644
index 000000000000..12bac61124e7
--- /dev/null
+++ b/test/Assembler/2007-03-18-InvalidNumberedVar.ll
@@ -0,0 +1,9 @@
+; PR 1258
+; RUN: not llvm-as < %s >/dev/null -f |& grep {'%0' defined with type 'i1'}
+
+define i32 @test1(i32 %a, i32 %b) {
+entry:
+ icmp eq i32 %b, %a ; <i1>:0 [#uses=1]
+ zext i1 %0 to i32 ; <i32>:0 [#uses=1]
+ ret i32 %0 ; Invalid Type for %0
+}
diff --git a/test/Assembler/2007-03-19-NegValue.ll b/test/Assembler/2007-03-19-NegValue.ll
new file mode 100644
index 000000000000..e90cf351e1d7
--- /dev/null
+++ b/test/Assembler/2007-03-19-NegValue.ll
@@ -0,0 +1,7 @@
+; Test whether negative values > 64 bits retain their negativeness.
+; RUN: llvm-as < %s | llvm-dis | grep {add i65.*, -1}
+
+define i65 @testConsts(i65 %N) {
+ %a = add i65 %N, -1
+ ret i65 %a
+}
diff --git a/test/Assembler/2007-04-20-AlignedLoad.ll b/test/Assembler/2007-04-20-AlignedLoad.ll
new file mode 100644
index 000000000000..f0217aec2ced
--- /dev/null
+++ b/test/Assembler/2007-04-20-AlignedLoad.ll
@@ -0,0 +1,7 @@
+; RUN: llvm-as < %s | llvm-dis | grep {align 1024}
+
+define i32 @test(i32* %arg) {
+entry:
+ %tmp2 = load i32* %arg, align 1024 ; <i32> [#uses=1]
+ ret i32 %tmp2
+}
diff --git a/test/Assembler/2007-04-20-AlignedStore.ll b/test/Assembler/2007-04-20-AlignedStore.ll
new file mode 100644
index 000000000000..1b08c48444c5
--- /dev/null
+++ b/test/Assembler/2007-04-20-AlignedStore.ll
@@ -0,0 +1,7 @@
+; RUN: llvm-as < %s | llvm-dis | grep {align 1024}
+
+define void @test(i32* %arg) {
+entry:
+ store i32 0, i32* %arg, align 1024
+ ret void
+}
diff --git a/test/Assembler/2007-04-25-AssemblerFoldExternWeak.ll b/test/Assembler/2007-04-25-AssemblerFoldExternWeak.ll
new file mode 100644
index 000000000000..c26d9ebc26c1
--- /dev/null
+++ b/test/Assembler/2007-04-25-AssemblerFoldExternWeak.ll
@@ -0,0 +1,6 @@
+; RUN: llvm-as < %s | llvm-dis | grep {icmp.*test_weak.*null}
+; PR1358
+@G = global i1 icmp ne (i32 (...)* @test_weak, i32 (...)* null)
+
+declare extern_weak i32 @test_weak(...)
+
diff --git a/test/Assembler/2007-05-21-Escape.ll b/test/Assembler/2007-05-21-Escape.ll
new file mode 100644
index 000000000000..08681339d212
--- /dev/null
+++ b/test/Assembler/2007-05-21-Escape.ll
@@ -0,0 +1,22 @@
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
+target triple = "x86_64-apple-darwin8"
+ %struct.bar = type { i32 }
+ %struct.foo = type { i32 }
+
+define i32 @"Func64"(%struct.bar* %F) {
+entry:
+ ret i32 1
+}
+
+define i32 @Func64(%struct.bar* %B) {
+entry:
+ ret i32 0
+}
+
+define i32 @test() {
+entry:
+ %tmp = tail call i32 @"Func64"( %struct.bar* null ) ; <i32> [#uses=0]
+ %tmp1 = tail call i32 @Func64( %struct.bar* null ) ; <i32> [#uses=0]
+ ret i32 undef
+}
diff --git a/test/Assembler/2007-07-19-ParamAttrAmbiguity.ll b/test/Assembler/2007-07-19-ParamAttrAmbiguity.ll
new file mode 100644
index 000000000000..9c7daa841ab8
--- /dev/null
+++ b/test/Assembler/2007-07-19-ParamAttrAmbiguity.ll
@@ -0,0 +1,9 @@
+; PR1553
+; RUN: llvm-as < %s > /dev/null
+define void @bar() {
+ %t = call i8 @foo( i8 10 )
+ zext i8 %t to i32
+ ret void
+}
+
+declare i8 @foo(i8)
diff --git a/test/Assembler/2007-07-30-AutoUpgradeZextSext.ll b/test/Assembler/2007-07-30-AutoUpgradeZextSext.ll
new file mode 100644
index 000000000000..ea2db4414f56
--- /dev/null
+++ b/test/Assembler/2007-07-30-AutoUpgradeZextSext.ll
@@ -0,0 +1,12 @@
+; Test that upgrading zext/sext attributes to zeroext and signext
+; works correctly.
+; PR1553
+; RUN: llvm-as < %s > /dev/null
+
+define i32 @bar() {
+ %t = call i8 @foo( i8 10 sext ) zext
+ %x = zext i8 %t to i32
+ ret i32 %x
+}
+
+declare i8 @foo(i8 signext ) zeroext
diff --git a/test/Assembler/2007-08-06-AliasInvalid.ll b/test/Assembler/2007-08-06-AliasInvalid.ll
new file mode 100644
index 000000000000..94095982468c
--- /dev/null
+++ b/test/Assembler/2007-08-06-AliasInvalid.ll
@@ -0,0 +1,9 @@
+; RUN: not llvm-as < %s > /dev/null |& grep {expected top-level entity}
+; PR1577
+
+@anInt = global i32 1
+alias i32 @anAlias
+
+define i32 @main() {
+ ret i32 0
+}
diff --git a/test/Assembler/2007-09-10-AliasFwdRef.ll b/test/Assembler/2007-09-10-AliasFwdRef.ll
new file mode 100644
index 000000000000..b21491ba5a90
--- /dev/null
+++ b/test/Assembler/2007-09-10-AliasFwdRef.ll
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | llvm-dis
+; PR1645
+
+@__gthread_active_ptr.5335 = internal constant i8* bitcast (i32 (i32)* @__gthrw_pthread_cancel to i8*)
+@__gthrw_pthread_cancel = alias weak i32 (i32)* @pthread_cancel
+
+
+
+declare extern_weak i32 @pthread_cancel(i32)
diff --git a/test/Assembler/2007-09-29-GC.ll b/test/Assembler/2007-09-29-GC.ll
new file mode 100644
index 000000000000..789a0fe1edc0
--- /dev/null
+++ b/test/Assembler/2007-09-29-GC.ll
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | llvm-dis | grep {@f.*gc.*shadowstack}
+; RUN: llvm-as < %s | llvm-dis | grep {@g.*gc.*java}
+
+define void @f() gc "shadowstack" {
+entry:
+ ret void
+}
+
+define void @g() gc "java" {
+entry:
+ ret void
+}
diff --git a/test/Assembler/2007-11-26-AttributeOverload.ll b/test/Assembler/2007-11-26-AttributeOverload.ll
new file mode 100644
index 000000000000..aebc2e8d01e5
--- /dev/null
+++ b/test/Assembler/2007-11-26-AttributeOverload.ll
@@ -0,0 +1,4 @@
+; RUN: not llvm-as < %s >& /dev/null
+
+declare i32 @atoi(i8*) nounwind readonly
+declare i32 @atoi(i8*)
diff --git a/test/Assembler/2007-11-27-AutoUpgradeAttributes.ll b/test/Assembler/2007-11-27-AutoUpgradeAttributes.ll
new file mode 100644
index 000000000000..ee260eadb7ae
--- /dev/null
+++ b/test/Assembler/2007-11-27-AutoUpgradeAttributes.ll
@@ -0,0 +1,3 @@
+; RUN: llvm-as < %s
+
+@FP = weak global i8 (...) signext * null
diff --git a/test/Assembler/2007-12-11-AddressSpaces.ll b/test/Assembler/2007-12-11-AddressSpaces.ll
new file mode 100644
index 000000000000..0eb4a797306d
--- /dev/null
+++ b/test/Assembler/2007-12-11-AddressSpaces.ll
@@ -0,0 +1,25 @@
+; RUN: llvm-as < %s | llvm-dis | grep {addrspace(33)} | count 7
+; RUN: llvm-as < %s | llvm-dis | grep {addrspace(42)} | count 2
+; RUN: llvm-as < %s | llvm-dis | grep {addrspace(66)} | count 2
+; RUN: llvm-as < %s | llvm-dis | grep {addrspace(11)} | count 6
+; RUN: llvm-as < %s | llvm-dis | grep {addrspace(22)} | count 5
+
+ %struct.mystruct = type { i32, i32 addrspace(33)*, i32, i32 addrspace(33)* }
+@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:
+ %tmp1 = load i32 addrspace(33)* addrspace(42)* getelementptr (%struct.mystruct addrspace(42)* @input, i32 0, i32 3), align 4 ; <i32 addrspace(33)*> [#uses=1]
+ store i32 addrspace(33)* %tmp1, i32 addrspace(33)* addrspace(66)* getelementptr (%struct.mystruct addrspace(66)* @output, i32 0, i32 1), align 4
+ ret void
+}
+
+define i32 addrspace(11)* @bar(i32 addrspace(11)* addrspace(22)* addrspace(33)* %x) {
+entry:
+ %tmp1 = load i32 addrspace(11)* addrspace(22)* addrspace(33)* @y, align 4 ; <i32 addrspace(11)* addrspace(22)*> [#uses=2]
+ store i32 addrspace(11)* addrspace(22)* %tmp1, i32 addrspace(11)* addrspace(22)* addrspace(33)* %x, align 4
+ %tmp5 = load i32 addrspace(11)* addrspace(22)* %tmp1, align 4 ; <i32 addrspace(11)*> [#uses=1]
+ ret i32 addrspace(11)* %tmp5
+}
diff --git a/test/Assembler/2008-01-11-VarargAttrs.ll b/test/Assembler/2008-01-11-VarargAttrs.ll
new file mode 100644
index 000000000000..c0aedc80b4c3
--- /dev/null
+++ b/test/Assembler/2008-01-11-VarargAttrs.ll
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llvm-dis | grep byval
+
+ %struct = type { }
+
+declare void @foo(...)
+
+define void @bar() {
+ call void (...)* @foo(%struct* byval null )
+ ret void
+}
diff --git a/test/Assembler/2008-02-18-IntPointerCrash.ll b/test/Assembler/2008-02-18-IntPointerCrash.ll
new file mode 100644
index 000000000000..5a661ad9b99a
--- /dev/null
+++ b/test/Assembler/2008-02-18-IntPointerCrash.ll
@@ -0,0 +1,6 @@
+; RUN: not llvm-as %s |& grep {integer constant must have integer type}
+; PR2060
+
+define i8* @foo() {
+ ret i8* 0
+}
diff --git a/test/Assembler/2008-02-20-MultipleReturnValue.ll b/test/Assembler/2008-02-20-MultipleReturnValue.ll
new file mode 100644
index 000000000000..5b2ed7e8f480
--- /dev/null
+++ b/test/Assembler/2008-02-20-MultipleReturnValue.ll
@@ -0,0 +1,22 @@
+; RUN: llvm-as < %s | opt -verify | llvm-dis | llvm-as -disable-output
+
+define {i32, i8} @foo(i32 %p) {
+ ret i32 1, i8 2
+}
+
+define i8 @f2(i32 %p) {
+ %c = call {i32, i8} @foo(i32 %p)
+ %d = getresult {i32, i8} %c, 1
+ %e = add i8 %d, 1
+ ret i8 %e
+}
+
+define i32 @f3(i32 %p) {
+ %c = invoke {i32, i8} @foo(i32 %p)
+ to label %L unwind label %L2
+ L:
+ %d = getresult {i32, i8} %c, 0
+ ret i32 %d
+ L2:
+ ret i32 0
+}
diff --git a/test/Assembler/2008-07-10-APInt.ll b/test/Assembler/2008-07-10-APInt.ll
new file mode 100644
index 000000000000..99347e92aba0
--- /dev/null
+++ b/test/Assembler/2008-07-10-APInt.ll
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | llvm-dis
+; PR2538
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
+target triple = "i686-pc-linux-gnu"
+
+define i128 @a() {
+ ret i128 18446744073709551616
+}
+
diff --git a/test/Assembler/2008-09-02-FunctionNotes.ll b/test/Assembler/2008-09-02-FunctionNotes.ll
new file mode 100644
index 000000000000..761c91e864c4
--- /dev/null
+++ b/test/Assembler/2008-09-02-FunctionNotes.ll
@@ -0,0 +1,14 @@
+; Test function attributes
+; RUN: llvm-as < %s | llvm-dis | grep inline | count 2
+
+define void @fn1() alwaysinline {
+ ret void
+}
+
+define void @fn2() noinline {
+ ret void
+}
+
+define void @fn3() {
+ ret void
+}
diff --git a/test/Assembler/2008-09-02-FunctionNotes2.ll b/test/Assembler/2008-09-02-FunctionNotes2.ll
new file mode 100644
index 000000000000..dbe75be700b7
--- /dev/null
+++ b/test/Assembler/2008-09-02-FunctionNotes2.ll
@@ -0,0 +1,6 @@
+; Test function notes
+; RUN: not llvm-as %s -o /dev/null -f |& grep "Attributes noinline alwaysinline are incompatible"
+define void @fn1() alwaysinline noinline {
+ ret void
+}
+
diff --git a/test/Assembler/2008-09-29-RetAttr.ll b/test/Assembler/2008-09-29-RetAttr.ll
new file mode 100644
index 000000000000..f7db96d22641
--- /dev/null
+++ b/test/Assembler/2008-09-29-RetAttr.ll
@@ -0,0 +1,13 @@
+; Test return attributes
+; RUN: llvm-as < %s | llvm-dis | grep "define inreg i32"
+; RUN: llvm-as < %s | llvm-dis | grep "call inreg i32"
+
+define inreg i32 @fn1() {
+ ret i32 0
+}
+
+define void @fn2() {
+ %t = call inreg i32 @fn1()
+ ret void
+}
+
diff --git a/test/Assembler/2008-10-14-NamedTypeOnInteger.ll b/test/Assembler/2008-10-14-NamedTypeOnInteger.ll
new file mode 100644
index 000000000000..009489dafd7a
--- /dev/null
+++ b/test/Assembler/2008-10-14-NamedTypeOnInteger.ll
@@ -0,0 +1,6 @@
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis
+; PR2733
+
+%t1 = type i32
+%t2 = type { %t1 }
+@i1 = constant %t2 { %t1 15 }
diff --git a/test/Assembler/2008-10-14-QuoteInName.ll b/test/Assembler/2008-10-14-QuoteInName.ll
new file mode 100644
index 000000000000..ccd77791caac
--- /dev/null
+++ b/test/Assembler/2008-10-14-QuoteInName.ll
@@ -0,0 +1,3 @@
+; RUN: llvm-as < %s | llvm-dis | grep "quote"
+
+@"a\22quote" = global i32 0
diff --git a/test/Assembler/2009-02-01-UnnamedForwardRef.ll b/test/Assembler/2009-02-01-UnnamedForwardRef.ll
new file mode 100644
index 000000000000..9c6e20d7335e
--- /dev/null
+++ b/test/Assembler/2009-02-01-UnnamedForwardRef.ll
@@ -0,0 +1,6 @@
+; RUN: llvm-as < %s | llvm-dis
+; PR3372
+
+@X = global i32* @0
+global i32 4
+
diff --git a/test/Assembler/2009-02-28-CastOpc.ll b/test/Assembler/2009-02-28-CastOpc.ll
new file mode 100644
index 000000000000..ee98d41bdf99
--- /dev/null
+++ b/test/Assembler/2009-02-28-CastOpc.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | llvm-dis
+
+type i32
+
+define void @foo() {
+ bitcast %0* null to i32*
+ ret void
+}
diff --git a/test/Assembler/2009-02-28-StripOpaqueName.ll b/test/Assembler/2009-02-28-StripOpaqueName.ll
new file mode 100644
index 000000000000..eef5d3614a81
--- /dev/null
+++ b/test/Assembler/2009-02-28-StripOpaqueName.ll
@@ -0,0 +1,6 @@
+; RUN: llvm-as < %s | opt -strip | llvm-dis | llvm-as | llvm-dis
+
+; Stripping the name from A should not break references to it.
+%A = type opaque
+@g1 = external global %A
+@g2 = global %A* @g1
diff --git a/test/Assembler/2009-03-24-ZextConstantExpr.ll b/test/Assembler/2009-03-24-ZextConstantExpr.ll
new file mode 100644
index 000000000000..daedb95da15a
--- /dev/null
+++ b/test/Assembler/2009-03-24-ZextConstantExpr.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llvm-dis
+; PR3876
+@gdtr = external global [0 x i8]
+
+define void @test() {
+ call zeroext i1 @paging_map(i64 zext (i32 and (i32 ptrtoint ([0 x i8]* @gdtr to i32), i32 -4096) to i64))
+ ret void
+}
+
+declare zeroext i1 @paging_map(i64)
+
diff --git a/test/Assembler/2009-04-25-AliasGEP.ll b/test/Assembler/2009-04-25-AliasGEP.ll
new file mode 100644
index 000000000000..6d07208defe3
--- /dev/null
+++ b/test/Assembler/2009-04-25-AliasGEP.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis
+; PR4066
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
+target triple = "i386-apple-darwin9"
+ %struct.i2c_device_id = type { }
+@w83l785ts_id = internal constant [0 x %struct.i2c_device_id] zeroinitializer, align 1 ; <[0 x %struct.i2c_device_id]*> [#uses=1]
+
+@__mod_i2c_device_table = alias getelementptr ([0 x %struct.i2c_device_id]* @w83l785ts_id, i32 0, i32 0) ; <%struct.i2c_device_id*> [#uses=0]
diff --git a/test/Assembler/AutoUpgradeIntrinsics.ll b/test/Assembler/AutoUpgradeIntrinsics.ll
new file mode 100644
index 000000000000..af4ec92e0991
--- /dev/null
+++ b/test/Assembler/AutoUpgradeIntrinsics.ll
@@ -0,0 +1,81 @@
+; Tests to make sure intrinsics are automatically upgraded.
+; RUN: llvm-as < %s | llvm-dis | not grep {i32 @llvm\\.ct}
+; RUN: llvm-as < %s | llvm-dis | \
+; RUN: not grep {llvm\\.part\\.set\\.i\[0-9\]*\\.i\[0-9\]*\\.i\[0-9\]*}
+; RUN: llvm-as < %s | llvm-dis | \
+; RUN: not grep {llvm\\.part\\.select\\.i\[0-9\]*\\.i\[0-9\]*}
+; RUN: llvm-as < %s | llvm-dis | \
+; RUN: not grep {llvm\\.bswap\\.i\[0-9\]*\\.i\[0-9\]*}
+; RUN: llvm-as < %s | llvm-dis | \
+; RUN: grep {llvm\\.x86\\.mmx\\.ps} | grep {\\\<2 x i32\\\>} | count 6
+
+declare i32 @llvm.ctpop.i28(i28 %val)
+declare i32 @llvm.cttz.i29(i29 %val)
+declare i32 @llvm.ctlz.i30(i30 %val)
+
+define i32 @test_ct(i32 %A) {
+ %c1 = call i32 @llvm.ctpop.i28(i28 1234)
+ %c2 = call i32 @llvm.cttz.i29(i29 2345)
+ %c3 = call i32 @llvm.ctlz.i30(i30 3456)
+ %r1 = add i32 %c1, %c2
+ %r2 = add i32 %r1, %c3
+ ret i32 %r2
+}
+
+declare i32 @llvm.part.set.i32.i32.i32(i32 %x, i32 %rep, i32 %hi, i32 %lo)
+declare i16 @llvm.part.set.i16.i16.i16(i16 %x, i16 %rep, i32 %hi, i32 %lo)
+define i32 @test_part_set(i32 %A, i16 %B) {
+ %a = call i32 @llvm.part.set.i32.i32.i32(i32 %A, i32 27, i32 8, i32 0)
+ %b = call i16 @llvm.part.set.i16.i16.i16(i16 %B, i16 27, i32 8, i32 0)
+ %c = zext i16 %b to i32
+ %d = add i32 %a, %c
+ ret i32 %d
+}
+
+declare i32 @llvm.part.select.i32.i32(i32 %x, i32 %hi, i32 %lo)
+declare i16 @llvm.part.select.i16.i16(i16 %x, i32 %hi, i32 %lo)
+define i32 @test_part_select(i32 %A, i16 %B) {
+ %a = call i32 @llvm.part.select.i32.i32(i32 %A, i32 8, i32 0)
+ %b = call i16 @llvm.part.select.i16.i16(i16 %B, i32 8, i32 0)
+ %c = zext i16 %b to i32
+ %d = add i32 %a, %c
+ ret i32 %d
+}
+
+declare i32 @llvm.bswap.i32.i32(i32 %x)
+declare i16 @llvm.bswap.i16.i16(i16 %x)
+define i32 @test_bswap(i32 %A, i16 %B) {
+ %a = call i32 @llvm.bswap.i32.i32(i32 %A)
+ %b = call i16 @llvm.bswap.i16.i16(i16 %B)
+ %c = zext i16 %b to i32
+ %d = add i32 %a, %c
+ ret i32 %d
+}
+
+declare <4 x i16> @llvm.x86.mmx.psra.w(<4 x i16>, <2 x i32>) nounwind readnone
+declare <4 x i16> @llvm.x86.mmx.psll.w(<4 x i16>, <2 x i32>) nounwind readnone
+declare <4 x i16> @llvm.x86.mmx.psrl.w(<4 x i16>, <2 x i32>) nounwind readnone
+define void @sh16(<4 x i16> %A, <2 x i32> %B) {
+ %r1 = call <4 x i16> @llvm.x86.mmx.psra.w( <4 x i16> %A, <2 x i32> %B ) ; <<4 x i16>> [#uses=0]
+ %r2 = call <4 x i16> @llvm.x86.mmx.psll.w( <4 x i16> %A, <2 x i32> %B ) ; <<4 x i16>> [#uses=0]
+ %r3 = call <4 x i16> @llvm.x86.mmx.psrl.w( <4 x i16> %A, <2 x i32> %B ) ; <<4 x i16>> [#uses=0]
+ ret void
+}
+
+declare <2 x i32> @llvm.x86.mmx.psra.d(<2 x i32>, <2 x i32>) nounwind readnone
+declare <2 x i32> @llvm.x86.mmx.psll.d(<2 x i32>, <2 x i32>) nounwind readnone
+declare <2 x i32> @llvm.x86.mmx.psrl.d(<2 x i32>, <2 x i32>) nounwind readnone
+define void @sh32(<2 x i32> %A, <2 x i32> %B) {
+ %r1 = call <2 x i32> @llvm.x86.mmx.psra.d( <2 x i32> %A, <2 x i32> %B ) ; <<2 x i32>> [#uses=0]
+ %r2 = call <2 x i32> @llvm.x86.mmx.psll.d( <2 x i32> %A, <2 x i32> %B ) ; <<2 x i32>> [#uses=0]
+ %r3 = call <2 x i32> @llvm.x86.mmx.psrl.d( <2 x i32> %A, <2 x i32> %B ) ; <<2 x i32>> [#uses=0]
+ ret void
+}
+
+declare <1 x i64> @llvm.x86.mmx.psll.q(<1 x i64>, <2 x i32>) nounwind readnone
+declare <1 x i64> @llvm.x86.mmx.psrl.q(<1 x i64>, <2 x i32>) nounwind readnone
+define void @sh64(<1 x i64> %A, <2 x i32> %B) {
+ %r1 = call <1 x i64> @llvm.x86.mmx.psll.q( <1 x i64> %A, <2 x i32> %B ) ; <<1 x i64>> [#uses=0]
+ %r2 = call <1 x i64> @llvm.x86.mmx.psrl.q( <1 x i64> %A, <2 x i32> %B ) ; <<1 x i64>> [#uses=0]
+ ret void
+}
diff --git a/test/Assembler/ConstantExprFold.ll b/test/Assembler/ConstantExprFold.ll
new file mode 100644
index 000000000000..89edc24b37ec
--- /dev/null
+++ b/test/Assembler/ConstantExprFold.ll
@@ -0,0 +1,30 @@
+; This test checks to make sure that constant exprs fold in some simple
+; situations
+
+; RUN: llvm-as < %s | llvm-dis | not grep {(}
+
+@A = global i64 0
+
+global i64* inttoptr (i64 add (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X + 0 == X
+global i64* inttoptr (i64 sub (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X - 0 == X
+global i64* inttoptr (i64 mul (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X * 0 == 0
+global i64* inttoptr (i64 sdiv (i64 ptrtoint (i64* @A to i64), i64 1) to i64*) ; X / 1 == X
+global i64* inttoptr (i64 srem (i64 ptrtoint (i64* @A to i64), i64 1) to i64*) ; X % 1 == 0
+global i64* inttoptr (i64 and (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X & 0 == 0
+global i64* inttoptr (i64 and (i64 ptrtoint (i64* @A to i64), i64 -1) to i64*) ; X & -1 == X
+global i64 or (i64 ptrtoint (i64* @A to i64), i64 -1) ; X | -1 == -1
+global i64* inttoptr (i64 xor (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X ^ 0 == X
+
+%Ty = type { i32, i32 }
+@B = external global %Ty
+
+global i1 icmp slt (i64* @A, i64* getelementptr (i64* @A, i64 1)) ; true
+global i1 icmp slt (i64* @A, i64* getelementptr (i64* @A, i64 0)) ; false
+global i1 icmp slt (i32* getelementptr (%Ty* @B, i64 0, i32 0),
+ i32* getelementptr (%Ty* @B, i64 0, i32 1)) ; true
+;global i1 icmp ne (i64* @A, i64* bitcast (%Ty* @B to i64*)) ; true
+
+; PR2206
+@cons = weak global i32 0, align 8 ; <i32*> [#uses=1]
+global i64 and (i64 ptrtoint (i32* @cons to i64), i64 7)
+
diff --git a/test/Assembler/ConstantExprFoldCast.ll b/test/Assembler/ConstantExprFoldCast.ll
new file mode 100644
index 000000000000..0ce6e84626a3
--- /dev/null
+++ b/test/Assembler/ConstantExprFoldCast.ll
@@ -0,0 +1,14 @@
+; This test checks to make sure that constant exprs fold in some simple situations
+
+; RUN: llvm-as < %s | llvm-dis | not grep cast
+
+@A = global i32* bitcast (i8* null to i32*) ; Cast null -> fold
+@B = global i32** bitcast (i32** @A to i32**) ; Cast to same type -> fold
+@C = global i32 trunc (i64 42 to i32) ; Integral casts
+@D = global i32* bitcast(float* bitcast (i32* @C to float*) to i32*) ; cast of cast ptr->ptr
+@E = global i32 ptrtoint(float* inttoptr (i8 5 to float*) to i32) ; i32 -> ptr -> i32
+
+; Test folding of binary instrs
+@F = global i32* inttoptr (i32 add (i32 5, i32 -5) to i32*)
+@G = global i32* inttoptr (i32 sub (i32 5, i32 5) to i32*)
+
diff --git a/test/Assembler/MultipleReturnValueType.ll b/test/Assembler/MultipleReturnValueType.ll
new file mode 100644
index 000000000000..617714394542
--- /dev/null
+++ b/test/Assembler/MultipleReturnValueType.ll
@@ -0,0 +1,13 @@
+; RUN: llvm-as < %s
+
+ %struct.S_102 = type { float, float }
+
+declare %struct.S_102 @f_102() nounwind
+
+@callthis = external global void ()* ; <void ()**> [#uses=50]
+
+
+define void @foo() {
+ store void ()* bitcast (%struct.S_102 ()* @f_102 to void ()*), void ()** @callthis, align 8
+ ret void
+}
diff --git a/test/Assembler/aggregate-constant-values.ll b/test/Assembler/aggregate-constant-values.ll
new file mode 100644
index 000000000000..a37d03ebb387
--- /dev/null
+++ b/test/Assembler/aggregate-constant-values.ll
@@ -0,0 +1,27 @@
+; RUN: llvm-as < %s | llvm-dis | grep 7 | count 3
+
+define void @foo({i32, i32}* %x) nounwind {
+ store {i32, i32}{i32 7, i32 9}, {i32, i32}* %x
+ ret void
+}
+define void @foo_empty({}* %x) nounwind {
+ store {}{}, {}* %x
+ ret void
+}
+define void @bar([2 x i32]* %x) nounwind {
+ store [2 x i32][i32 7, i32 9], [2 x i32]* %x
+ ret void
+}
+define void @bar_empty([0 x i32]* %x) nounwind {
+ store [0 x i32][], [0 x i32]* %x
+ ret void
+}
+define void @qux(<{i32, i32}>* %x) nounwind {
+ store <{i32, i32}><{i32 7, i32 9}>, <{i32, i32}>* %x
+ ret void
+}
+define void @qux_empty(<{}>* %x) nounwind {
+ store <{}><{}>, <{}>* %x
+ ret void
+}
+
diff --git a/test/Assembler/aggregate-return-single-value.ll b/test/Assembler/aggregate-return-single-value.ll
new file mode 100644
index 000000000000..02fb59f8a0a4
--- /dev/null
+++ b/test/Assembler/aggregate-return-single-value.ll
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llvm-dis
+
+define { i32 } @fooa() nounwind {
+ ret i32 0
+}
+define { i32 } @foob() nounwind {
+ ret {i32}{ i32 0 }
+}
+define [1 x i32] @fooc() nounwind {
+ ret i32 0
+}
+define [1 x i32] @food() nounwind {
+ ret [1 x i32][ i32 0 ]
+}
diff --git a/test/Assembler/anon-functions.ll b/test/Assembler/anon-functions.ll
new file mode 100644
index 000000000000..e08063e655d6
--- /dev/null
+++ b/test/Assembler/anon-functions.ll
@@ -0,0 +1,26 @@
+; RUN: llvm-as < %s |llvm-dis | llvm-as | llvm-dis
+; PR3611
+
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
+target triple = "x86_64-unknown-linux-gnu"
+
+@f = alias void ()* @0 ; <void ()*> [#uses=0]
+@g = alias void ()* @1 ; <void ()*> [#uses=0]
+@h = external global void ()* ; <void ()*> [#uses=0]
+
+define internal void @0() nounwind {
+entry:
+ store void()* @0, void()** @h
+ br label %return
+
+return: ; preds = %entry
+ ret void
+}
+
+define internal void @1() nounwind {
+entry:
+ br label %return
+
+return: ; preds = %entry
+ ret void
+}
diff --git a/test/Assembler/bcwrap.ll b/test/Assembler/bcwrap.ll
new file mode 100644
index 000000000000..859dc4bc80f9
--- /dev/null
+++ b/test/Assembler/bcwrap.ll
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s > %t
+; RUN: llvm-nm %t | grep foo
+; test for isBitcodeFile, llvm-nm must read from a file for this test
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
+target triple = "i686-apple-darwin9.2.2"
+
+define i32 @foo() {
+ ret i32 0
+}
diff --git a/test/Assembler/dg.exp b/test/Assembler/dg.exp
new file mode 100644
index 000000000000..f2005891a59a
--- /dev/null
+++ b/test/Assembler/dg.exp
@@ -0,0 +1,3 @@
+load_lib llvm.exp
+
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
diff --git a/test/Assembler/getelementptr.ll b/test/Assembler/getelementptr.ll
new file mode 100644
index 000000000000..10e5011397da
--- /dev/null
+++ b/test/Assembler/getelementptr.ll
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis
+
+;; Verify that i16 indices work.
+@x = external global {i32, i32}
+@y = global i32* getelementptr ({i32, i32}* @x, i16 42, i32 0)
+
+; see if i92 indices work too.
+define i32 *@test({i32, i32}* %t, i92 %n) {
+ %B = getelementptr {i32, i32}* %t, i92 %n, i32 0
+ ret i32* %B
+}
+
diff --git a/test/Assembler/getelementptr_struct.ll b/test/Assembler/getelementptr_struct.ll
new file mode 100644
index 000000000000..c8779a64077c
--- /dev/null
+++ b/test/Assembler/getelementptr_struct.ll
@@ -0,0 +1,12 @@
+; RUN: not llvm-as < %s >/dev/null |& grep {invalid getelementptr indices}
+; Test the case of a incorrect indices type into struct
+
+%RT = type { i8 , [10 x [20 x i32]], i8 }
+%ST = type { i32, double, %RT }
+
+define i32* @foo(%ST* %s) {
+entry:
+ %reg = getelementptr %ST* %s, i32 1, i64 2, i32 1, i32 5, i32 13
+ ret i32* %reg
+}
+
diff --git a/test/Assembler/huge-array.ll b/test/Assembler/huge-array.ll
new file mode 100644
index 000000000000..e080947b9945
--- /dev/null
+++ b/test/Assembler/huge-array.ll
@@ -0,0 +1,5 @@
+; RUN: llvm-as < %s | llvm-dis | grep 18446744073709551615 | count 2
+
+define [18446744073709551615 x i8]* @foo() {
+ ret [18446744073709551615 x i8]* null
+}
diff --git a/test/Assembler/insertextractvalue.ll b/test/Assembler/insertextractvalue.ll
new file mode 100644
index 000000000000..3581238aa4c1
--- /dev/null
+++ b/test/Assembler/insertextractvalue.ll
@@ -0,0 +1,23 @@
+; RUN: llvm-as < %s | llvm-dis > %t
+; RUN: grep insertvalue %t | count 1
+; RUN: grep extractvalue %t | count 1
+
+define float @foo({{i32},{float, double}}* %p) nounwind {
+ %t = load {{i32},{float, double}}* %p
+ %s = extractvalue {{i32},{float, double}} %t, 1, 0
+ %r = insertvalue {{i32},{float, double}} %t, double 2.0, 1, 1
+ store {{i32},{float, double}} %r, {{i32},{float, double}}* %p
+ ret float %s
+}
+define float @bar({{i32},{float, double}}* %p) nounwind {
+ store {{i32},{float, double}} insertvalue ({{i32},{float, double}}{{i32}{i32 4},{float, double}{float 4.0, double 5.0}}, double 20.0, 1, 1), {{i32},{float, double}}* %p
+ ret float extractvalue ({{i32},{float, double}}{{i32}{i32 3},{float, double}{float 7.0, double 9.0}}, 1, 0)
+}
+define float @car({{i32},{float, double}}* %p) nounwind {
+ store {{i32},{float, double}} insertvalue ({{i32},{float, double}} undef, double 20.0, 1, 1), {{i32},{float, double}}* %p
+ ret float extractvalue ({{i32},{float, double}} undef, 1, 0)
+}
+define float @dar({{i32},{float, double}}* %p) nounwind {
+ store {{i32},{float, double}} insertvalue ({{i32},{float, double}} zeroinitializer, double 20.0, 1, 1), {{i32},{float, double}}* %p
+ ret float extractvalue ({{i32},{float, double}} zeroinitializer, 1, 0)
+}
diff --git a/test/Assembler/numbered-values.ll b/test/Assembler/numbered-values.ll
new file mode 100644
index 000000000000..2439c831a706
--- /dev/null
+++ b/test/Assembler/numbered-values.ll
@@ -0,0 +1,16 @@
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis
+; PR2480
+
+define i32 @test(i32 %X) nounwind {
+entry:
+ %X_addr = alloca i32 ; <i32*> [#uses=2]
+ %retval = alloca i32 ; <i32*> [#uses=2]
+ %0 = alloca i32 ; <i32*>:0 [#uses=2]
+ %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
+ store i32 %X, i32* %X_addr
+ %1 = load i32* %X_addr, align 4 ; <i32>:1 [#uses=1]
+ mul i32 %1, 4 ; <i32>:2 [#uses=1]
+ %3 = add i32 %2, 123 ; <i32>:3 [#uses=1]
+ store i32 %3, i32* %0, align 4
+ ret i32 %3
+}
diff --git a/test/Assembler/private.ll b/test/Assembler/private.ll
new file mode 100644
index 000000000000..37145727a589
--- /dev/null
+++ b/test/Assembler/private.ll
@@ -0,0 +1,9 @@
+; Test to make sure that the 'private' tag is not lost!
+;
+; RUN: llvm-as < %s | llvm-dis | grep private
+
+declare void @foo()
+
+define private void @foo() {
+ ret void
+}
diff --git a/test/Assembler/select.ll b/test/Assembler/select.ll
new file mode 100644
index 000000000000..b018fbe9c416
--- /dev/null
+++ b/test/Assembler/select.ll
@@ -0,0 +1,9 @@
+; RUN: llvm-as %s -o /dev/null -f
+
+
+define i32 @test(i1 %C, i32 %V1, i32 %V2) {
+ %X = select i1 true, i1 false, i1 true ; <i1> [#uses=1]
+ %V = select i1 %X, i32 %V1, i32 %V2 ; <i32> [#uses=1]
+ ret i32 %V
+}
+
diff --git a/test/Assembler/vbool-cmp.ll b/test/Assembler/vbool-cmp.ll
new file mode 100644
index 000000000000..ac8fb29362f7
--- /dev/null
+++ b/test/Assembler/vbool-cmp.ll
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep {icmp slt}
+; rudimentary test of fcmp/icmp on vectors returning vector of bool
+
+define <4 x i1> @ffoo(<4 x float> %a, <4 x float> %b) nounwind {
+entry:
+ %cmp = fcmp olt <4 x float> %a, %b ; <4 x i1> [#uses=1]
+ ret <4 x i1> %cmp
+}
+
+define <4 x i1> @ifoo(<4 x i32> %a, <4 x i32> %b) nounwind {
+entry:
+ %cmp = icmp slt <4 x i32> %a, %b ; <4 x i1> [#uses=1]
+ ret <4 x i1> %cmp
+}
+
diff --git a/test/Assembler/vector-cmp.ll b/test/Assembler/vector-cmp.ll
new file mode 100644
index 000000000000..383c0faf6206
--- /dev/null
+++ b/test/Assembler/vector-cmp.ll
@@ -0,0 +1,16 @@
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep {global.*vicmp slt}
+; PR2317
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
+target triple = "i686-apple-darwin9.2.2"
+
+define <4 x i32> @foo(<4 x float> %a, <4 x float> %b) nounwind {
+entry:
+ %cmp = vfcmp olt <4 x float> %a, %b ; <4 x i32> [#uses=1]
+ ret <4 x i32> %cmp
+}
+
+global <4 x i32> vicmp slt ( <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 1, i32 2, i32 1, i32 2> ) ;
+
+@B = external global i32;
+
+global <4 x i32> vicmp slt ( <4 x i32> <i32 ptrtoint (i32 * @B to i32), i32 1, i32 1, i32 1>, <4 x i32> <i32 1, i32 2, i32 1, i32 2> ) ;
diff --git a/test/Assembler/vector-select.ll b/test/Assembler/vector-select.ll
new file mode 100644
index 000000000000..87af602aaf59
--- /dev/null
+++ b/test/Assembler/vector-select.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep select
+; rudimentary test of select on vectors returning vector of bool
+
+define <4 x i32> @foo(<4 x i32> %a, <4 x i32> %b,
+ <4 x i1> %cond) nounwind {
+entry:
+ %cmp = select <4 x i1> %cond, <4 x i32> %a, <4 x i32> %b
+ ; <4 x i32> [#uses=1]
+ ret <4 x i32> %cmp
+}
+
diff --git a/test/Assembler/vector-shift.ll b/test/Assembler/vector-shift.ll
new file mode 100644
index 000000000000..1850e66e8edc
--- /dev/null
+++ b/test/Assembler/vector-shift.ll
@@ -0,0 +1,32 @@
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep shl | count 1
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep ashr | count 1
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep lshr | count 1
+
+define <4 x i32> @foo(<4 x i32> %a, <4 x i32> %b) nounwind {
+entry:
+ %cmp = shl <4 x i32> %a, %b ; <4 x i32> [#uses=1]
+ ret <4 x i32> %cmp
+}
+
+define <4 x i32> @bar(<4 x i32> %a, <4 x i32> %b) nounwind {
+entry:
+ %cmp = lshr <4 x i32> %a, %b ; <4 x i32> [#uses=1]
+ ret <4 x i32> %cmp
+}
+
+define <4 x i32> @baz(<4 x i32> %a, <4 x i32> %b) nounwind {
+entry:
+ %cmp = ashr <4 x i32> %a, %b ; <4 x i32> [#uses=1]
+ ret <4 x i32> %cmp
+}
+
+; Constant expressions: these should be folded.
+define <2 x i64> @foo_ce() nounwind {
+ ret <2 x i64> shl (<2 x i64> <i64 5, i64 6>, <2 x i64> <i64 3, i64 5>)
+}
+define <2 x i64> @bar_ce() nounwind {
+ ret <2 x i64> lshr (<2 x i64> <i64 340, i64 380>, <2 x i64> <i64 3, i64 5>)
+}
+define <2 x i64> @baz_ce() nounwind {
+ ret <2 x i64> ashr (<2 x i64> <i64 573, i64 411>, <2 x i64> <i64 3, i64 5>)
+}