diff options
author | Stephen Hines <srhines@google.com> | 2014-12-01 14:51:49 -0800 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2014-12-02 16:08:10 -0800 |
commit | 37ed9c199ca639565f6ce88105f9e39e898d82d0 (patch) | |
tree | 8fb36d3910e3ee4c4e1b7422f4f017108efc52f5 /test/Assembler | |
parent | d2327b22152ced7bc46dc629fc908959e8a52d03 (diff) | |
download | external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.zip external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.gz external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.bz2 |
Update aosp/master LLVM for rebase to r222494.
Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
Diffstat (limited to 'test/Assembler')
136 files changed, 474 insertions, 51 deletions
diff --git a/test/Assembler/2002-03-08-NameCollision.ll b/test/Assembler/2002-03-08-NameCollision.ll index b49789b..089d3fb 100644 --- a/test/Assembler/2002-03-08-NameCollision.ll +++ b/test/Assembler/2002-03-08-NameCollision.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s ; Method arguments were being checked for collisions at the global scope before ; the method object was created by the parser. Because of this, false diff --git a/test/Assembler/2002-03-08-NameCollision2.ll b/test/Assembler/2002-03-08-NameCollision2.ll index 1f7a4e1..dc98a36 100644 --- a/test/Assembler/2002-03-08-NameCollision2.ll +++ b/test/Assembler/2002-03-08-NameCollision2.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s ; Another name collision problem. Here the problem was that if a forward ; declaration for a method was found, that this would cause spurious conflicts diff --git a/test/Assembler/2002-04-07-HexFloatConstants.ll b/test/Assembler/2002-04-07-HexFloatConstants.ll index b0d7cc0..90ee85a 100644 --- a/test/Assembler/2002-04-07-HexFloatConstants.ll +++ b/test/Assembler/2002-04-07-HexFloatConstants.ll @@ -9,6 +9,7 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | opt -constprop | \ ; RUN: llvm-dis > %t.2 ; RUN: diff %t.1 %t.2 +; RUN: verify-uselistorder %s define double @test() { %tmp = fmul double 7.200000e+101, 0x427F4000 ; <double> [#uses=1] diff --git a/test/Assembler/2002-04-07-InfConstant.ll b/test/Assembler/2002-04-07-InfConstant.ll index 71837c9..6cd5447 100644 --- a/test/Assembler/2002-04-07-InfConstant.ll +++ b/test/Assembler/2002-04-07-InfConstant.ll @@ -1,6 +1,7 @@ ; The output formater prints out 1.0e100 as Inf! ; ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep 0x7FF0000000000000 +; RUN: verify-uselistorder %s define float @test() { %tmp = fmul float 0x7FF0000000000000, 1.000000e+01 ; <float> [#uses=1] diff --git a/test/Assembler/2002-04-29-NameBinding.ll b/test/Assembler/2002-04-29-NameBinding.ll index 7960c20..960209b 100644 --- a/test/Assembler/2002-04-29-NameBinding.ll +++ b/test/Assembler/2002-04-29-NameBinding.ll @@ -7,6 +7,7 @@ ; RUN: opt < %s -globaldce -S | \ ; RUN: not grep constant ; +; RUN: verify-uselistorder %s @v1 = internal constant i32 5 diff --git a/test/Assembler/2002-05-02-InvalidForwardRef.ll b/test/Assembler/2002-05-02-InvalidForwardRef.ll index 234545c..38c42b3 100644 --- a/test/Assembler/2002-05-02-InvalidForwardRef.ll +++ b/test/Assembler/2002-05-02-InvalidForwardRef.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s ; It looks like the assembler is not forward resolving the function declaraion ; correctly. diff --git a/test/Assembler/2002-07-14-OpaqueType.ll b/test/Assembler/2002-07-14-OpaqueType.ll index 662fb0f..6256aab 100644 --- a/test/Assembler/2002-07-14-OpaqueType.ll +++ b/test/Assembler/2002-07-14-OpaqueType.ll @@ -1,6 +1,7 @@ ; Test that opaque types are preserved correctly ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis ; +; RUN: verify-uselistorder %s %Ty = type opaque diff --git a/test/Assembler/2002-07-25-QuoteInString.ll b/test/Assembler/2002-07-25-QuoteInString.ll index facc5bd..1545680 100644 --- a/test/Assembler/2002-07-25-QuoteInString.ll +++ b/test/Assembler/2002-07-25-QuoteInString.ll @@ -1,5 +1,6 @@ ; Test double quotes in strings work correctly! ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis ; +; RUN: verify-uselistorder %s @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 index 6988fad..fdee93c 100644 --- a/test/Assembler/2002-07-25-ReturnPtrFunction.ll +++ b/test/Assembler/2002-07-25-ReturnPtrFunction.ll @@ -2,6 +2,7 @@ ; the right thing. ; ; RUN: llvm-as < %s | llvm-dis | llvm-as +; RUN: verify-uselistorder %s declare void (i32)* @foo() diff --git a/test/Assembler/2002-07-31-SlashInString.ll b/test/Assembler/2002-07-31-SlashInString.ll index ff48258..879a965 100644 --- a/test/Assembler/2002-07-31-SlashInString.ll +++ b/test/Assembler/2002-07-31-SlashInString.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as +; RUN: verify-uselistorder %s ; 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 index c716524..5f952b4 100644 --- a/test/Assembler/2002-08-15-CastAmbiguity.ll +++ b/test/Assembler/2002-08-15-CastAmbiguity.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s define void @test(i32 %X) { call void @test( i32 6 ) diff --git a/test/Assembler/2002-08-15-ConstantExprProblem.ll b/test/Assembler/2002-08-15-ConstantExprProblem.ll index 02b9ea9..343a104 100644 --- a/test/Assembler/2002-08-15-ConstantExprProblem.ll +++ b/test/Assembler/2002-08-15-ConstantExprProblem.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s @.LC0 = internal global [12 x i8] c"hello world\00" ; <[12 x i8]*> [#uses=1] diff --git a/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll b/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll index 2ba3f14..6bbe0cf 100644 --- a/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll +++ b/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s @.LC0 = internal global [12 x i8] c"hello world\00" ; <[12 x i8]*> [#uses=1] diff --git a/test/Assembler/2002-08-16-ConstExprInlined.ll b/test/Assembler/2002-08-16-ConstExprInlined.ll index f233bac..b78d858 100644 --- a/test/Assembler/2002-08-16-ConstExprInlined.ll +++ b/test/Assembler/2002-08-16-ConstExprInlined.ll @@ -9,6 +9,7 @@ ; around! ; ; RUN: llvm-as < %s | llvm-dis | llvm-as +; RUN: verify-uselistorder %s @.LC0 = internal global [4 x i8] c"foo\00" ; <[4 x i8]*> [#uses=1] @X = global i8* null ; <i8**> [#uses=0] diff --git a/test/Assembler/2002-08-19-BytecodeReader.ll b/test/Assembler/2002-08-19-BytecodeReader.ll index e211014..0722885 100644 --- a/test/Assembler/2002-08-19-BytecodeReader.ll +++ b/test/Assembler/2002-08-19-BytecodeReader.ll @@ -2,6 +2,7 @@ ; "crafty" spec benchmark. ; ; RUN: opt < %s -instcombine | llvm-dis +; RUN: verify-uselistorder %s %CHESS_POSITION = type { i32, i32 } @pawn_probes = external global i32 ; <i32*> [#uses=0] diff --git a/test/Assembler/2002-08-22-DominanceProblem.ll b/test/Assembler/2002-08-22-DominanceProblem.ll index 0dc192d..5048610 100644 --- a/test/Assembler/2002-08-22-DominanceProblem.ll +++ b/test/Assembler/2002-08-22-DominanceProblem.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s ; Dominance relationships is not calculated correctly for unreachable blocks, ; which causes the verifier to barf on this input. diff --git a/test/Assembler/2002-10-08-LargeArrayPerformance.ll b/test/Assembler/2002-10-08-LargeArrayPerformance.ll index 34a9932..acd9280 100644 --- a/test/Assembler/2002-10-08-LargeArrayPerformance.ll +++ b/test/Assembler/2002-10-08-LargeArrayPerformance.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s ; This testcase comes from the following really simple c file: ;; int foo[30000] ;;; We should not be soo slow for such a simple case! diff --git a/test/Assembler/2002-10-13-ConstantEncodingProblem.ll b/test/Assembler/2002-10-13-ConstantEncodingProblem.ll index bf3a521..a0f7b3d 100644 --- a/test/Assembler/2002-10-13-ConstantEncodingProblem.ll +++ b/test/Assembler/2002-10-13-ConstantEncodingProblem.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis +; RUN: verify-uselistorder %s %Domain = type { %Domain**, %Domain* } @D = global %Domain zeroinitializer ; <%Domain*> [#uses=0] diff --git a/test/Assembler/2002-12-15-GlobalResolve.ll b/test/Assembler/2002-12-15-GlobalResolve.ll index a873a61..87608cc 100644 --- a/test/Assembler/2002-12-15-GlobalResolve.ll +++ b/test/Assembler/2002-12-15-GlobalResolve.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s @X = external global i32* @X1 = external global %T* diff --git a/test/Assembler/2003-01-30-UnsignedString.ll b/test/Assembler/2003-01-30-UnsignedString.ll index 3c14d71..27550ad 100644 --- a/test/Assembler/2003-01-30-UnsignedString.ll +++ b/test/Assembler/2003-01-30-UnsignedString.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s @spell_order = global [4 x i8] c"\FF\00\F7\00" diff --git a/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll b/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll index f1a5ed7..61fd911 100644 --- a/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll +++ b/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s ; There should be absolutely no problem with this testcase. define i32 @test(i32 %arg1, i32 %arg2) { diff --git a/test/Assembler/2003-05-03-BytecodeReaderProblem.ll b/test/Assembler/2003-05-03-BytecodeReaderProblem.ll index f4a6911..5cd57ea 100644 --- a/test/Assembler/2003-05-03-BytecodeReaderProblem.ll +++ b/test/Assembler/2003-05-03-BytecodeReaderProblem.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis +; RUN: verify-uselistorder %s define void @test() { %tmp.123 = trunc i64 0 to i32 ; <i32> [#uses=0] diff --git a/test/Assembler/2003-05-12-MinIntProblem.ll b/test/Assembler/2003-05-12-MinIntProblem.ll index ebe1690..1064a76 100644 --- a/test/Assembler/2003-05-12-MinIntProblem.ll +++ b/test/Assembler/2003-05-12-MinIntProblem.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | grep -- -2147483648 +; RUN: verify-uselistorder %s define i32 @foo() { ret i32 -2147483648 diff --git a/test/Assembler/2003-05-15-AssemblerProblem.ll b/test/Assembler/2003-05-15-AssemblerProblem.ll index 146ce65..eba26a2 100644 --- a/test/Assembler/2003-05-15-AssemblerProblem.ll +++ b/test/Assembler/2003-05-15-AssemblerProblem.ll @@ -1,6 +1,7 @@ ; 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 +; RUN: verify-uselistorder %s define void @test() { call void (...)* bitcast (void (i16*, i32)* @AddString to void (...)*)( i16* null, i32 0 ) diff --git a/test/Assembler/2003-05-15-SwitchBug.ll b/test/Assembler/2003-05-15-SwitchBug.ll index 3768d9c..432be81 100644 --- a/test/Assembler/2003-05-15-SwitchBug.ll +++ b/test/Assembler/2003-05-15-SwitchBug.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s ; Check minimal switch statement diff --git a/test/Assembler/2003-05-21-ConstantShiftExpr.ll b/test/Assembler/2003-05-21-ConstantShiftExpr.ll index 40b9651..5b8e5d2 100644 --- a/test/Assembler/2003-05-21-ConstantShiftExpr.ll +++ b/test/Assembler/2003-05-21-ConstantShiftExpr.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s ; 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 index 26e83d9..934e32a 100644 --- a/test/Assembler/2003-05-21-EmptyStructTest.ll +++ b/test/Assembler/2003-05-21-EmptyStructTest.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s ; 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. diff --git a/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll b/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll index 50cdeed..911f0ff 100644 --- a/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll +++ b/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s -instcombine -simplifycfg -S | not grep br +; RUN: verify-uselistorder %s @.str_1 = internal constant [6 x i8] c"_Bool\00" ; <[6 x i8]*> [#uses=2] diff --git a/test/Assembler/2003-08-21-ConstantExprCast-Fold.ll b/test/Assembler/2003-08-21-ConstantExprCast-Fold.ll index b76f774..926d4ed 100644 --- a/test/Assembler/2003-08-21-ConstantExprCast-Fold.ll +++ b/test/Assembler/2003-08-21-ConstantExprCast-Fold.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | not grep getelementptr +; RUN: verify-uselistorder %s @A = external global { float } ; <{ float }*> [#uses=2] global i32* bitcast ({ float }* @A to i32*) ; <i32**>:0 [#uses=0] diff --git a/test/Assembler/2003-11-05-ConstantExprShift.ll b/test/Assembler/2003-11-05-ConstantExprShift.ll index 86b093e..ddfceca 100644 --- a/test/Assembler/2003-11-05-ConstantExprShift.ll +++ b/test/Assembler/2003-11-05-ConstantExprShift.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis +; RUN: verify-uselistorder %s define i32 @test() { ret i32 ashr (i32 ptrtoint (i32 ()* @test to i32), i32 2) diff --git a/test/Assembler/2003-11-12-ConstantExprCast.ll b/test/Assembler/2003-11-12-ConstantExprCast.ll index 47a5353..c9ad266 100644 --- a/test/Assembler/2003-11-12-ConstantExprCast.ll +++ b/test/Assembler/2003-11-12-ConstantExprCast.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | not grep " bitcast (" +; RUN: verify-uselistorder %s @.Base64_1 = external constant [4 x i8] ; <[4 x i8]*> [#uses=1] diff --git a/test/Assembler/2004-01-11-getelementptrfolding.ll b/test/Assembler/2004-01-11-getelementptrfolding.ll index 5249d0e..188a95f 100644 --- a/test/Assembler/2004-01-11-getelementptrfolding.ll +++ b/test/Assembler/2004-01-11-getelementptrfolding.ll @@ -1,5 +1,6 @@ ; RUN: llvm-as < %s | llvm-dis | \ ; RUN: not grep "getelementptr.*getelementptr" +; RUN: verify-uselistorder %s %struct.TTriangleItem = type { i8*, i8*, [3 x %struct.TUVVertex] } %struct.TUVVertex = type { i16, i16, i16, i16 } diff --git a/test/Assembler/2004-01-20-MaxLongLong.ll b/test/Assembler/2004-01-20-MaxLongLong.ll index 8af5332..23eb402 100644 --- a/test/Assembler/2004-01-20-MaxLongLong.ll +++ b/test/Assembler/2004-01-20-MaxLongLong.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | grep 9223372036854775808 +; RUN: verify-uselistorder %s global i64 -9223372036854775808 diff --git a/test/Assembler/2004-02-01-NegativeZero.ll b/test/Assembler/2004-02-01-NegativeZero.ll index b28930f..98bd4cb 100644 --- a/test/Assembler/2004-02-01-NegativeZero.ll +++ b/test/Assembler/2004-02-01-NegativeZero.ll @@ -1,5 +1,9 @@ -; RUN: llvm-as < %s | llvm-dis | grep -- -0.0 +; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s +; CHECK: global double -0.000000e+00 global double 0x8000000000000000 + +; CHECK: global float -0.000000e+00 global float -0.0 diff --git a/test/Assembler/2004-02-27-SelfUseAssertError.ll b/test/Assembler/2004-02-27-SelfUseAssertError.ll index 7052eac..252a1b2 100644 --- a/test/Assembler/2004-02-27-SelfUseAssertError.ll +++ b/test/Assembler/2004-02-27-SelfUseAssertError.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s ; %inc2 uses it's own value, but that's ok, as it's unreachable! diff --git a/test/Assembler/2004-03-07-FunctionAddressAlignment.ll b/test/Assembler/2004-03-07-FunctionAddressAlignment.ll index e3bf0bb..7fa0802 100644 --- a/test/Assembler/2004-03-07-FunctionAddressAlignment.ll +++ b/test/Assembler/2004-03-07-FunctionAddressAlignment.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | not grep ptrtoint +; RUN: verify-uselistorder %s ; All of these should be eliminable diff --git a/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll b/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll index ab46f88..a86fe63 100644 --- a/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll +++ b/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s define i32* @t1({ float, i32 }* %X) { %W = getelementptr { float, i32 }* %X, i32 20, i32 1 ; <i32*> [#uses=0] diff --git a/test/Assembler/2004-06-07-VerifierBug.ll b/test/Assembler/2004-06-07-VerifierBug.ll index 07d2383..090599a 100644 --- a/test/Assembler/2004-06-07-VerifierBug.ll +++ b/test/Assembler/2004-06-07-VerifierBug.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s > /dev/null +; RUN: verify-uselistorder %s define void @t() { entry: diff --git a/test/Assembler/2004-10-22-BCWriterUndefBug.ll b/test/Assembler/2004-10-22-BCWriterUndefBug.ll index 694b80b..b934131 100644 --- a/test/Assembler/2004-10-22-BCWriterUndefBug.ll +++ b/test/Assembler/2004-10-22-BCWriterUndefBug.ll @@ -1,5 +1,6 @@ ;; The bytecode writer was trying to treat undef values as ConstantArray's when ;; they looked like strings. ;; RUN: llvm-as %s -o /dev/null +;; RUN: verify-uselistorder %s @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 index 4db5b74..7260f19 100644 --- a/test/Assembler/2004-11-28-InvalidTypeCrash.ll +++ b/test/Assembler/2004-11-28-InvalidTypeCrash.ll @@ -1,4 +1,5 @@ ; Test for PR463. This program is erroneous, but should not crash llvm-as. -; RUN: not llvm-as %s -o /dev/null 2>&1 | grep "use of undefined type named 'struct.none'" +; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s +; CHECK: use of undefined type named 'struct.none' @.FOO = internal global %struct.none zeroinitializer diff --git a/test/Assembler/2005-01-03-FPConstantDisassembly.ll b/test/Assembler/2005-01-03-FPConstantDisassembly.ll index aaa776f..643d04c 100644 --- a/test/Assembler/2005-01-03-FPConstantDisassembly.ll +++ b/test/Assembler/2005-01-03-FPConstantDisassembly.ll @@ -1,6 +1,8 @@ -; RUN: llvm-as < %s | llvm-dis | grep 1.0 +; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s define double @test() { +; CHECK: ret double 1.0 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 index ce769a2..a5a917d 100644 --- a/test/Assembler/2005-01-31-CallingAggregateFunction.ll +++ b/test/Assembler/2005-01-31-CallingAggregateFunction.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s define void @test() { call {i32} @foo() diff --git a/test/Assembler/2005-05-05-OpaqueUndefValues.ll b/test/Assembler/2005-05-05-OpaqueUndefValues.ll index 8cd1419..01456f1 100644 --- a/test/Assembler/2005-05-05-OpaqueUndefValues.ll +++ b/test/Assembler/2005-05-05-OpaqueUndefValues.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as > /dev/null +; RUN: verify-uselistorder %s %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 index d3a692c..edcf605 100644 --- a/test/Assembler/2005-12-21-ZeroInitVector.ll +++ b/test/Assembler/2005-12-21-ZeroInitVector.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s > /dev/null +; RUN: verify-uselistorder %s define <4 x i32> @foo() { ret <4 x i32> zeroinitializer diff --git a/test/Assembler/2006-12-09-Cast-To-Bool.ll b/test/Assembler/2006-12-09-Cast-To-Bool.ll index a70262c..91abe77 100644 --- a/test/Assembler/2006-12-09-Cast-To-Bool.ll +++ b/test/Assembler/2006-12-09-Cast-To-Bool.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | grep bitcast +; RUN: verify-uselistorder %s define i1 @main(i32 %X) { %res = bitcast i1 true to i1 diff --git a/test/Assembler/2007-01-02-Undefined-Arg-Type.ll b/test/Assembler/2007-01-02-Undefined-Arg-Type.ll index 184e543..a0542ee 100644 --- a/test/Assembler/2007-01-02-Undefined-Arg-Type.ll +++ b/test/Assembler/2007-01-02-Undefined-Arg-Type.ll @@ -1,5 +1,7 @@ ; The assembler should catch an undefined argument type . -; RUN: not llvm-as %s -o /dev/null 2>&1 | grep "use of undefined type named 'typedef.bc_struct'" +; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s + +; CHECK: use of undefined type named 'typedef.bc_struct' ; %typedef.bc_struct = type opaque diff --git a/test/Assembler/2007-01-05-Cmp-ConstExpr.ll b/test/Assembler/2007-01-05-Cmp-ConstExpr.ll index e3f67ba..54a4372 100644 --- a/test/Assembler/2007-01-05-Cmp-ConstExpr.ll +++ b/test/Assembler/2007-01-05-Cmp-ConstExpr.ll @@ -1,5 +1,6 @@ ; Test Case for PR1080 ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s @str = internal constant [4 x i8] c"-ga\00" ; <[4 x i8]*> [#uses=2] diff --git a/test/Assembler/2007-03-19-NegValue.ll b/test/Assembler/2007-03-19-NegValue.ll index 64eb3cb..a2deac2 100644 --- a/test/Assembler/2007-03-19-NegValue.ll +++ b/test/Assembler/2007-03-19-NegValue.ll @@ -1,7 +1,9 @@ ; Test whether negative values > 64 bits retain their negativeness. -; RUN: llvm-as < %s | llvm-dis | grep "add i65.*, -1" +; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s define i65 @testConsts(i65 %N) { +; CHECK: add i65 %N, -1 %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 index 98a5428..bcf65fd 100644 --- a/test/Assembler/2007-04-20-AlignedLoad.ll +++ b/test/Assembler/2007-04-20-AlignedLoad.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | grep "align 1024" +; RUN: verify-uselistorder %s define i32 @test(i32* %arg) { entry: diff --git a/test/Assembler/2007-04-20-AlignedStore.ll b/test/Assembler/2007-04-20-AlignedStore.ll index 9e4dd9f..9605af2 100644 --- a/test/Assembler/2007-04-20-AlignedStore.ll +++ b/test/Assembler/2007-04-20-AlignedStore.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | grep "align 1024" +; RUN: verify-uselistorder %s define void @test(i32* %arg) { entry: diff --git a/test/Assembler/2007-04-25-AssemblerFoldExternWeak.ll b/test/Assembler/2007-04-25-AssemblerFoldExternWeak.ll index b0ca1aa..7c73abc 100644 --- a/test/Assembler/2007-04-25-AssemblerFoldExternWeak.ll +++ b/test/Assembler/2007-04-25-AssemblerFoldExternWeak.ll @@ -1,5 +1,8 @@ -; RUN: llvm-as < %s | llvm-dis | grep "icmp.*test_weak.*null" +; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; PR1358 + +; CHECK: icmp ne (i32 (...)* @test_weak, i32 (...)* null) @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 index 0868133..9716244 100644 --- a/test/Assembler/2007-05-21-Escape.ll +++ b/test/Assembler/2007-05-21-Escape.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis +; RUN: verify-uselistorder %s 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 } diff --git a/test/Assembler/2007-07-19-ParamAttrAmbiguity.ll b/test/Assembler/2007-07-19-ParamAttrAmbiguity.ll index 9c7daa8..68aeef2 100644 --- a/test/Assembler/2007-07-19-ParamAttrAmbiguity.ll +++ b/test/Assembler/2007-07-19-ParamAttrAmbiguity.ll @@ -1,5 +1,6 @@ ; PR1553 ; RUN: llvm-as < %s > /dev/null +; RUN: verify-uselistorder %s define void @bar() { %t = call i8 @foo( i8 10 ) zext i8 %t to i32 diff --git a/test/Assembler/2007-09-10-AliasFwdRef.ll b/test/Assembler/2007-09-10-AliasFwdRef.ll index 2ebfc27..8e0a571 100644 --- a/test/Assembler/2007-09-10-AliasFwdRef.ll +++ b/test/Assembler/2007-09-10-AliasFwdRef.ll @@ -1,8 +1,9 @@ ; RUN: llvm-as < %s | llvm-dis +; RUN: verify-uselistorder %s ; 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 +@__gthrw_pthread_cancel = weak alias i32 (i32)* @pthread_cancel diff --git a/test/Assembler/2007-09-29-GC.ll b/test/Assembler/2007-09-29-GC.ll index 9aefd0b..f2cafbc 100644 --- a/test/Assembler/2007-09-29-GC.ll +++ b/test/Assembler/2007-09-29-GC.ll @@ -1,5 +1,9 @@ -; RUN: llvm-as < %s | llvm-dis | grep "@f.*gc.*shadowstack" -; RUN: llvm-as < %s | llvm-dis | grep "@g.*gc.*java" +; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s + + +; CHECK: define void @f() gc "shadowstack" +; CHECK: define void @g() gc "java" define void @f() gc "shadowstack" { entry: diff --git a/test/Assembler/2007-12-11-AddressSpaces.ll b/test/Assembler/2007-12-11-AddressSpaces.ll index 7c9b5b5..f860f57 100644 --- a/test/Assembler/2007-12-11-AddressSpaces.ll +++ b/test/Assembler/2007-12-11-AddressSpaces.ll @@ -3,6 +3,7 @@ ; 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 +; RUN: verify-uselistorder %s %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] diff --git a/test/Assembler/2008-01-11-VarargAttrs.ll b/test/Assembler/2008-01-11-VarargAttrs.ll index c0aedc8..0b6592c 100644 --- a/test/Assembler/2008-01-11-VarargAttrs.ll +++ b/test/Assembler/2008-01-11-VarargAttrs.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | grep byval +; RUN: verify-uselistorder %s %struct = type { } diff --git a/test/Assembler/2008-07-10-APInt.ll b/test/Assembler/2008-07-10-APInt.ll index 99347e9..fe3608d 100644 --- a/test/Assembler/2008-07-10-APInt.ll +++ b/test/Assembler/2008-07-10-APInt.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis +; RUN: verify-uselistorder %s ; 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" diff --git a/test/Assembler/2008-09-02-FunctionNotes.ll b/test/Assembler/2008-09-02-FunctionNotes.ll index 11a0411..a629c93 100644 --- a/test/Assembler/2008-09-02-FunctionNotes.ll +++ b/test/Assembler/2008-09-02-FunctionNotes.ll @@ -1,5 +1,6 @@ ; Test function attributes ; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; CHECK: define void @fn1() #0 define void @fn1() alwaysinline { diff --git a/test/Assembler/2008-09-29-RetAttr.ll b/test/Assembler/2008-09-29-RetAttr.ll index f7db96d..5eb608d 100644 --- a/test/Assembler/2008-09-29-RetAttr.ll +++ b/test/Assembler/2008-09-29-RetAttr.ll @@ -1,6 +1,7 @@ ; Test return attributes ; RUN: llvm-as < %s | llvm-dis | grep "define inreg i32" ; RUN: llvm-as < %s | llvm-dis | grep "call inreg i32" +; RUN: verify-uselistorder %s define inreg i32 @fn1() { ret i32 0 diff --git a/test/Assembler/2008-10-14-QuoteInName.ll b/test/Assembler/2008-10-14-QuoteInName.ll index ccd7779..aa95e79 100644 --- a/test/Assembler/2008-10-14-QuoteInName.ll +++ b/test/Assembler/2008-10-14-QuoteInName.ll @@ -1,3 +1,4 @@ ; RUN: llvm-as < %s | llvm-dis | grep "quote" +; RUN: verify-uselistorder %s @"a\22quote" = global i32 0 diff --git a/test/Assembler/2009-02-01-UnnamedForwardRef.ll b/test/Assembler/2009-02-01-UnnamedForwardRef.ll index 9c6e20d..5b1d9ee 100644 --- a/test/Assembler/2009-02-01-UnnamedForwardRef.ll +++ b/test/Assembler/2009-02-01-UnnamedForwardRef.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis +; RUN: verify-uselistorder %s ; PR3372 @X = global i32* @0 diff --git a/test/Assembler/2009-02-28-CastOpc.ll b/test/Assembler/2009-02-28-CastOpc.ll index 6035643..e9d2308 100644 --- a/test/Assembler/2009-02-28-CastOpc.ll +++ b/test/Assembler/2009-02-28-CastOpc.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis +; RUN: verify-uselistorder %s define void @foo() { diff --git a/test/Assembler/2009-02-28-StripOpaqueName.ll b/test/Assembler/2009-02-28-StripOpaqueName.ll index f61a44c..614cc57 100644 --- a/test/Assembler/2009-02-28-StripOpaqueName.ll +++ b/test/Assembler/2009-02-28-StripOpaqueName.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s -strip -S | llvm-as | llvm-dis +; RUN: verify-uselistorder %s ; Stripping the name from A should not break references to it. %A = type opaque diff --git a/test/Assembler/2009-03-24-ZextConstantExpr.ll b/test/Assembler/2009-03-24-ZextConstantExpr.ll index daedb95..98bab4b 100644 --- a/test/Assembler/2009-03-24-ZextConstantExpr.ll +++ b/test/Assembler/2009-03-24-ZextConstantExpr.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis +; RUN: verify-uselistorder %s ; PR3876 @gdtr = external global [0 x i8] diff --git a/test/Assembler/2009-07-24-ZeroArgGEP.ll b/test/Assembler/2009-07-24-ZeroArgGEP.ll index 2a3d114..92f4d59 100644 --- a/test/Assembler/2009-07-24-ZeroArgGEP.ll +++ b/test/Assembler/2009-07-24-ZeroArgGEP.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s @foo = global i32 0 @bar = constant i32* getelementptr(i32* @foo) diff --git a/test/Assembler/2010-02-05-FunctionLocalMetadataBecomesNull.ll b/test/Assembler/2010-02-05-FunctionLocalMetadataBecomesNull.ll index 17dd745..5cb869d 100644 --- a/test/Assembler/2010-02-05-FunctionLocalMetadataBecomesNull.ll +++ b/test/Assembler/2010-02-05-FunctionLocalMetadataBecomesNull.ll @@ -1,4 +1,5 @@ -; RUN: opt -std-compile-opts < %s | llvm-dis | not grep badref +; RUN: opt -O3 < %s | llvm-dis | not grep badref +; RUN: verify-uselistorder %s 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-n8:16:32:64" target triple = "x86_64-apple-darwin10.2" @@ -11,7 +12,7 @@ target triple = "x86_64-apple-darwin10.2" define i32 @main() nounwind readonly { %diff1 = alloca i64 ; <i64*> [#uses=2] - call void @llvm.dbg.declare(metadata !{i64* %diff1}, metadata !0) + call void @llvm.dbg.declare(metadata !{i64* %diff1}, metadata !0, metadata !{metadata !"0x102"}) store i64 72, i64* %diff1, align 8 %v1 = load %struct.test** @TestArrayPtr, align 8 ; <%struct.test*> [#uses=1] %v2 = ptrtoint %struct.test* %v1 to i64 ; <i64> [#uses=1] @@ -20,15 +21,15 @@ define i32 @main() nounwind readonly { ret i32 4 } -declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone +declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !7 = metadata !{metadata !1} -!6 = metadata !{i32 786449, metadata !8, i32 12, metadata !"clang version 3.0 (trunk 131941)", i1 true, metadata !"", i32 0, metadata !9, metadata !9, metadata !7, null, null, metadata !""} ; [ DW_TAG_compile_unit ] -!0 = metadata !{i32 786688, metadata !1, metadata !"c", metadata !2, i32 2, metadata !5, i32 0, null} ; [ DW_TAG_auto_variable ] -!1 = metadata !{i32 786478, metadata !8, metadata !2, metadata !"main", metadata !"main", metadata !"", i32 1, metadata !3, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 ()* @main, null, null, null, i32 1} ; [ DW_TAG_subprogram ] -!2 = metadata !{i32 786473, metadata !8} ; [ DW_TAG_file_type ] -!3 = metadata !{i32 786453, metadata !8, metadata !2, metadata !"", i32 0, i64 0, i64 0, i32 0, i32 0, null, metadata !4, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!6 = metadata !{metadata !"0x11\0012\00clang version 3.0 (trunk 131941)\001\00\000\00\000", metadata !8, metadata !9, metadata !9, metadata !7, null, null} ; [ DW_TAG_compile_unit ] +!0 = metadata !{metadata !"0x100\00c\002\000", metadata !1, metadata !2, metadata !5} ; [ DW_TAG_auto_variable ] +!1 = metadata !{metadata !"0x2e\00main\00main\00\001\000\001\000\006\00256\000\001", metadata !8, metadata !2, metadata !3, null, i32 ()* @main, null, null, null} ; [ DW_TAG_subprogram ] +!2 = metadata !{metadata !"0x29", metadata !8} ; [ DW_TAG_file_type ] +!3 = metadata !{metadata !"0x15\00\000\000\000\000\000\000", metadata !8, metadata !2, null, metadata !4, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] !4 = metadata !{metadata !5} -!5 = metadata !{i32 786468, null, metadata !6, metadata !"int", i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] +!5 = metadata !{metadata !"0x24\00int\000\0032\0032\000\000\005", null, metadata !6} ; [ DW_TAG_base_type ] !8 = metadata !{metadata !"/d/j/debug-test.c", metadata !"/Volumes/Data/b"} !9 = metadata !{i32 0} diff --git a/test/Assembler/ConstantExprFold.ll b/test/Assembler/ConstantExprFold.ll index fc18ce7..dc41331 100644 --- a/test/Assembler/ConstantExprFold.ll +++ b/test/Assembler/ConstantExprFold.ll @@ -2,6 +2,7 @@ ; situations ; RUN: llvm-as < %s | llvm-dis | not grep "(" +; RUN: verify-uselistorder %s @A = global i64 0 diff --git a/test/Assembler/ConstantExprFoldCast.ll b/test/Assembler/ConstantExprFoldCast.ll index 161a4ca..094f87b 100644 --- a/test/Assembler/ConstantExprFoldCast.ll +++ b/test/Assembler/ConstantExprFoldCast.ll @@ -1,6 +1,7 @@ ; This test checks to make sure that constant exprs fold in some simple situations ; RUN: llvm-as < %s | llvm-dis | not grep cast +; RUN: verify-uselistorder %s @A = global i32* bitcast (i8* null to i32*) ; Cast null -> fold @B = global i32** bitcast (i32** @A to i32**) ; Cast to same type -> fold diff --git a/test/Assembler/ConstantExprFoldSelect.ll b/test/Assembler/ConstantExprFoldSelect.ll index b000e02..5d218a9 100644 --- a/test/Assembler/ConstantExprFoldSelect.ll +++ b/test/Assembler/ConstantExprFoldSelect.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; PR18319 define void @function() { diff --git a/test/Assembler/ConstantExprNoFold.ll b/test/Assembler/ConstantExprNoFold.ll index b41959f..8d03e7a 100644 --- a/test/Assembler/ConstantExprNoFold.ll +++ b/test/Assembler/ConstantExprNoFold.ll @@ -2,6 +2,7 @@ ; situations ; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; Even give it a datalayout, to tempt folding as much as possible. target datalayout = "p:32:32" @@ -24,3 +25,15 @@ target datalayout = "p:32:32" ; CHECK: @E = global i64 addrspace(1)* addrspacecast (i64* @A to i64 addrspace(1)*) @E = global i64 addrspace(1)* addrspacecast(i64* @A to i64 addrspace(1)*) + +; Don't add an inbounds on @weak.gep, since @weak may be null. +; CHECK: @weak.gep = global i32* getelementptr (i32* @weak, i32 1) +@weak.gep = global i32* getelementptr (i32* @weak, i32 1) +@weak = extern_weak global i32 + +; Don't add an inbounds on @glob.a3, since it's not inbounds. +; CHECK: @glob.a3 = alias getelementptr (i32* @glob.a2, i32 1) +@glob = global i32 0 +@glob.a3 = alias getelementptr (i32* @glob.a2, i32 1) +@glob.a2 = alias getelementptr (i32* @glob.a1, i32 1) +@glob.a1 = alias i32* @glob diff --git a/test/Assembler/MultipleReturnValueType.ll b/test/Assembler/MultipleReturnValueType.ll index 6177143..5812632 100644 --- a/test/Assembler/MultipleReturnValueType.ll +++ b/test/Assembler/MultipleReturnValueType.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s +; RUN: verify-uselistorder %s %struct.S_102 = type { float, float } diff --git a/test/Assembler/addrspacecast-alias.ll b/test/Assembler/addrspacecast-alias.ll index d751659..745e525 100644 --- a/test/Assembler/addrspacecast-alias.ll +++ b/test/Assembler/addrspacecast-alias.ll @@ -1,7 +1,8 @@ ; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; Test that global aliases are allowed to be constant addrspacecast @i = internal addrspace(1) global i8 42 -@ia = alias internal addrspacecast (i8 addrspace(1)* @i to i8 addrspace(2)* addrspace(3)*) -; CHECK: @ia = alias internal addrspacecast (i8 addrspace(2)* addrspace(1)* bitcast (i8 addrspace(1)* @i to i8 addrspace(2)* addrspace(1)*) to i8 addrspace(2)* addrspace(3)*) +@ia = internal alias addrspacecast (i8 addrspace(1)* @i to i8 addrspace(2)* addrspace(3)*) +; CHECK: @ia = internal alias addrspacecast (i8 addrspace(2)* addrspace(1)* bitcast (i8 addrspace(1)* @i to i8 addrspace(2)* addrspace(1)*) to i8 addrspace(2)* addrspace(3)*) diff --git a/test/Assembler/aggregate-constant-values.ll b/test/Assembler/aggregate-constant-values.ll index d0aab81..9e68e06 100644 --- a/test/Assembler/aggregate-constant-values.ll +++ b/test/Assembler/aggregate-constant-values.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; CHECK: @foo ; CHECK: store { i32, i32 } { i32 7, i32 9 }, { i32, i32 }* %x diff --git a/test/Assembler/aggregate-return-single-value.ll b/test/Assembler/aggregate-return-single-value.ll index 04540b5..a77c250 100644 --- a/test/Assembler/aggregate-return-single-value.ll +++ b/test/Assembler/aggregate-return-single-value.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis +; RUN: verify-uselistorder %s define { i32 } @foob() nounwind { ret {i32}{ i32 0 } diff --git a/test/Assembler/alias-use-list-order.ll b/test/Assembler/alias-use-list-order.ll new file mode 100644 index 0000000..d29fd6e --- /dev/null +++ b/test/Assembler/alias-use-list-order.ll @@ -0,0 +1,11 @@ +; RUN: verify-uselistorder < %s + +; Globals. +@global = global i32 0 +@alias.ref1 = global i32* getelementptr inbounds (i32* @alias, i64 1) +@alias.ref2 = global i32* getelementptr inbounds (i32* @alias, i64 1) + +; Aliases. +@alias = alias i32* @global +@alias.ref3 = alias i32* getelementptr inbounds (i32* @alias, i64 1) +@alias.ref4 = alias i32* getelementptr inbounds (i32* @alias, i64 1) diff --git a/test/Assembler/align-inst.ll b/test/Assembler/align-inst.ll index 6f7100e..1952fbc 100644 --- a/test/Assembler/align-inst.ll +++ b/test/Assembler/align-inst.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s @A = global i1 0, align 536870912 diff --git a/test/Assembler/alignstack.ll b/test/Assembler/alignstack.ll index 9f2059f..784f44a 100644 --- a/test/Assembler/alignstack.ll +++ b/test/Assembler/alignstack.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s 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-darwin10.0" diff --git a/test/Assembler/anon-functions.ll b/test/Assembler/anon-functions.ll index ac06e8c..42eea83 100644 --- a/test/Assembler/anon-functions.ll +++ b/test/Assembler/anon-functions.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis +; RUN: verify-uselistorder %s ; 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" diff --git a/test/Assembler/atomic.ll b/test/Assembler/atomic.ll index d7ccd99..0356f5f 100644 --- a/test/Assembler/atomic.ll +++ b/test/Assembler/atomic.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s | opt -S | FileCheck %s +; RUN: verify-uselistorder %s ; Basic smoke test for atomic operations. define void @f(i32* %x) { diff --git a/test/Assembler/auto_upgrade_intrinsics.ll b/test/Assembler/auto_upgrade_intrinsics.ll index 8f655ce..f16e5fe 100644 --- a/test/Assembler/auto_upgrade_intrinsics.ll +++ b/test/Assembler/auto_upgrade_intrinsics.ll @@ -1,5 +1,6 @@ ; Test to make sure intrinsics are automatically upgraded. ; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s declare i8 @llvm.ctlz.i8(i8) declare i16 @llvm.ctlz.i16(i16) diff --git a/test/Assembler/bcwrap.ll b/test/Assembler/bcwrap.ll index 4bec48c..bc260ab 100644 --- a/test/Assembler/bcwrap.ll +++ b/test/Assembler/bcwrap.ll @@ -1,5 +1,6 @@ ; RUN: llvm-as < %s > %t ; RUN: llvm-nm %t | FileCheck %s +; RUN: verify-uselistorder %s ; 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" diff --git a/test/Assembler/comment.ll b/test/Assembler/comment.ll index 16362ab..edf0989 100644 --- a/test/Assembler/comment.ll +++ b/test/Assembler/comment.ll @@ -1,5 +1,6 @@ ; RUN: llvm-as < %s | llvm-dis -show-annotations | FileCheck -check-prefix=ANNOT %s ; RUN: llvm-as < %s | llvm-dis | FileCheck -check-prefix=BARE %s +; RUN: verify-uselistorder %s ; The bare version of this file should not have any #uses lines. ; BARE: @B = diff --git a/test/Assembler/externally-initialized.ll b/test/Assembler/externally-initialized.ll index 4be6e62..ea93367 100644 --- a/test/Assembler/externally-initialized.ll +++ b/test/Assembler/externally-initialized.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; CHECK: @G = externally_initialized global i32 0 diff --git a/test/Assembler/fast-math-flags.ll b/test/Assembler/fast-math-flags.ll index 3a116c5..8e75bdf 100644 --- a/test/Assembler/fast-math-flags.ll +++ b/test/Assembler/fast-math-flags.ll @@ -1,5 +1,6 @@ ; RUN: llvm-as < %s | llvm-dis | FileCheck %s ; RUN: opt -S < %s | FileCheck %s +; RUN: verify-uselistorder %s @addr = external global i64 @select = external global i1 diff --git a/test/Assembler/flags.ll b/test/Assembler/flags.ll index 310b807..e74311a 100644 --- a/test/Assembler/flags.ll +++ b/test/Assembler/flags.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s @addr = external global i64 diff --git a/test/Assembler/functionlocal-metadata.ll b/test/Assembler/functionlocal-metadata.ll index f9b1d74..c46233a 100644 --- a/test/Assembler/functionlocal-metadata.ll +++ b/test/Assembler/functionlocal-metadata.ll @@ -1,34 +1,35 @@ ; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s define void @Foo(i32 %a, i32 %b) { entry: - call void @llvm.dbg.value(metadata !{ i32* %1 }, i64 16, metadata !2) -; CHECK: call void @llvm.dbg.value(metadata !{i32* %1}, i64 16, metadata ![[ID2:[0-9]+]]) + call void @llvm.dbg.value(metadata !{ i32* %1 }, i64 16, metadata !2, metadata !{metadata !"0x102"}) +; CHECK: call void @llvm.dbg.value(metadata !{i32* %1}, i64 16, metadata ![[ID2:[0-9]+]], metadata {{.*}}) %0 = add i32 %a, 1 ; <i32> [#uses=1] %two = add i32 %b, %0 ; <i32> [#uses=0] %1 = alloca i32 ; <i32*> [#uses=1] - call void @llvm.dbg.declare(metadata !{i32* %1}, metadata !{i32* %1}) -; CHECK: metadata !{i32* %1}, metadata !{i32* %1} - call void @llvm.dbg.declare(metadata !{i32 %two}, metadata !{i32 %0}) -; CHECK: metadata !{i32 %two}, metadata !{i32 %0} - call void @llvm.dbg.declare(metadata !{i32 %0}, metadata !{i32* %1, i32 %0}) -; CHECK: metadata !{i32 %0}, metadata !{i32* %1, i32 %0} - call void @llvm.dbg.declare(metadata !{i32* %1}, metadata !{i32 %b, i32 %0}) -; CHECK: metadata !{i32* %1}, metadata !{i32 %b, i32 %0} - call void @llvm.dbg.declare(metadata !{i32 %a}, metadata !{i32 %a, metadata !"foo"}) -; CHECK: metadata !{i32 %a}, metadata !{i32 %a, metadata !"foo"} - call void @llvm.dbg.declare(metadata !{i32 %b}, metadata !{metadata !0, i32 %two}) -; CHECK: metadata !{i32 %b}, metadata !{metadata ![[ID0:[0-9]+]], i32 %two} - - call void @llvm.dbg.value(metadata !{ i32 %a }, i64 0, metadata !1) -; CHECK: metadata !{i32 %a}, i64 0, metadata ![[ID1:[0-9]+]] - call void @llvm.dbg.value(metadata !{ i32 %0 }, i64 25, metadata !0) -; CHECK: metadata !{i32 %0}, i64 25, metadata ![[ID0]] - call void @llvm.dbg.value(metadata !{ i32* %1 }, i64 16, metadata !3) -; CHECK: call void @llvm.dbg.value(metadata !{i32* %1}, i64 16, metadata ![[ID3:[0-9]+]]) - call void @llvm.dbg.value(metadata !3, i64 12, metadata !2) -; CHECK: metadata ![[ID3]], i64 12, metadata ![[ID2]] + call void @llvm.dbg.declare(metadata !{i32* %1}, metadata !{i32* %1}, metadata !{metadata !"0x102"}) +; CHECK: call void @llvm.dbg.declare(metadata !{i32* %1}, metadata !{i32* %1}, metadata {{.*}}) + call void @llvm.dbg.declare(metadata !{i32 %two}, metadata !{i32 %0}, metadata !{metadata !"0x102"}) +; CHECK: call void @llvm.dbg.declare(metadata !{i32 %two}, metadata !{i32 %0}, metadata {{.*}}) + call void @llvm.dbg.declare(metadata !{i32 %0}, metadata !{i32* %1, i32 %0}, metadata !{metadata !"0x102"}) +; CHECK: call void @llvm.dbg.declare(metadata !{i32 %0}, metadata !{i32* %1, i32 %0}, metadata {{.*}}) + call void @llvm.dbg.declare(metadata !{i32* %1}, metadata !{i32 %b, i32 %0}, metadata !{metadata !"0x102"}) +; CHECK: call void @llvm.dbg.declare(metadata !{i32* %1}, metadata !{i32 %b, i32 %0}, metadata {{.*}}) + call void @llvm.dbg.declare(metadata !{i32 %a}, metadata !{i32 %a, metadata !"foo"}, metadata !{metadata !"0x102"}) +; CHECK: call void @llvm.dbg.declare(metadata !{i32 %a}, metadata !{i32 %a, metadata !"foo"}, metadata {{.*}}) + call void @llvm.dbg.declare(metadata !{i32 %b}, metadata !{metadata !0, i32 %two}, metadata !{metadata !"0x102"}) +; CHECK: call void @llvm.dbg.declare(metadata !{i32 %b}, metadata !{metadata ![[ID0:[0-9]+]], i32 %two}, metadata {{.*}}) + + call void @llvm.dbg.value(metadata !{ i32 %a }, i64 0, metadata !1, metadata !{metadata !"0x102"}) +; CHECK: call void @llvm.dbg.value(metadata !{i32 %a}, i64 0, metadata ![[ID1:[0-9]+]], metadata {{.*}}) + call void @llvm.dbg.value(metadata !{ i32 %0 }, i64 25, metadata !0, metadata !{metadata !"0x102"}) +; CHECK: call void @llvm.dbg.value(metadata !{i32 %0}, i64 25, metadata ![[ID0]], metadata {{.*}}) + call void @llvm.dbg.value(metadata !{ i32* %1 }, i64 16, metadata !3, metadata !{metadata !"0x102"}) +; CHECK: call void @llvm.dbg.value(metadata !{i32* %1}, i64 16, metadata ![[ID3:[0-9]+]], metadata {{.*}}) + call void @llvm.dbg.value(metadata !3, i64 12, metadata !2, metadata !{metadata !"0x102"}) +; CHECK: call void @llvm.dbg.value(metadata ![[ID3]], i64 12, metadata ![[ID2]], metadata {{.*}}) ret void, !foo !0, !bar !1 ; CHECK: ret void, !foo ![[FOO:[0-9]+]], !bar ![[BAR:[0-9]+]] @@ -40,10 +41,10 @@ entry: !1 = metadata !{i32 4, metadata !"foo"} !2 = metadata !{metadata !"bar"} !3 = metadata !{metadata !"foo"} -!4 = metadata !{i32 1, metadata !"Debug Info Version", i32 1} +!4 = metadata !{i32 1, metadata !"Debug Info Version", i32 2} -declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone -declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone +declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone +declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone !foo = !{ !0 } !bar = !{ !1 } diff --git a/test/Assembler/getelementptr.ll b/test/Assembler/getelementptr.ll index af03fca..e938ff4 100644 --- a/test/Assembler/getelementptr.ll +++ b/test/Assembler/getelementptr.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; Verify that over-indexed getelementptrs are folded. @A = external global [2 x [3 x [5 x [7 x i32]]]] diff --git a/test/Assembler/global-addrspace-forwardref.ll b/test/Assembler/global-addrspace-forwardref.ll index f0f094a..4a036e0 100644 --- a/test/Assembler/global-addrspace-forwardref.ll +++ b/test/Assembler/global-addrspace-forwardref.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; Make sure the address space of forward decls is preserved diff --git a/test/Assembler/half-constprop.ll b/test/Assembler/half-constprop.ll index 9e24f72..c5ae3bf 100644 --- a/test/Assembler/half-constprop.ll +++ b/test/Assembler/half-constprop.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s -O3 -S | FileCheck %s +; RUN: verify-uselistorder %s ; Testing half constant propagation. define half @abc() nounwind { diff --git a/test/Assembler/half-conv.ll b/test/Assembler/half-conv.ll index 70a6b86..e6f73cf 100644 --- a/test/Assembler/half-conv.ll +++ b/test/Assembler/half-conv.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s -O3 -S | FileCheck %s +; RUN: verify-uselistorder %s ; Testing half to float conversion. define float @abc() nounwind { diff --git a/test/Assembler/half.ll b/test/Assembler/half.ll index 63ad392..cbd03cb 100644 --- a/test/Assembler/half.ll +++ b/test/Assembler/half.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; Basic smoke test for half type. ; CHECK: define half @halftest diff --git a/test/Assembler/huge-array.ll b/test/Assembler/huge-array.ll index a1abf87..6f89e83 100644 --- a/test/Assembler/huge-array.ll +++ b/test/Assembler/huge-array.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; CHECK: define [18446744073709551615 x i8]* @foo() { ; CHECK: ret [18446744073709551615 x i8]* null diff --git a/test/Assembler/inalloca.ll b/test/Assembler/inalloca.ll index ff7a87e..a8c47b4 100644 --- a/test/Assembler/inalloca.ll +++ b/test/Assembler/inalloca.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s define void @a() { entry: diff --git a/test/Assembler/inline-asm-clobber.ll b/test/Assembler/inline-asm-clobber.ll new file mode 100644 index 0000000..65c8e44 --- /dev/null +++ b/test/Assembler/inline-asm-clobber.ll @@ -0,0 +1,10 @@ +; RUN: not llvm-as <%s 2>&1 | FileCheck %s + +; "~x{21}" is not a valid clobber constraint. + +; CHECK: invalid type for inline asm constraint string + +define void @foo() nounwind { + call void asm sideeffect "mov x0, #42", "~{x0},~{x19},~x{21}"() nounwind + ret void +} diff --git a/test/Assembler/insertextractvalue.ll b/test/Assembler/insertextractvalue.ll index 6c00b13..692843e 100644 --- a/test/Assembler/insertextractvalue.ll +++ b/test/Assembler/insertextractvalue.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; CHECK: @foo ; CHECK-NEXT: load diff --git a/test/Assembler/internal-hidden-alias.ll b/test/Assembler/internal-hidden-alias.ll index 660514b..df547c0 100644 --- a/test/Assembler/internal-hidden-alias.ll +++ b/test/Assembler/internal-hidden-alias.ll @@ -2,5 +2,5 @@ @global = global i32 0 -@alias = hidden alias internal i32* @global +@alias = internal hidden alias i32* @global ; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/internal-protected-alias.ll b/test/Assembler/internal-protected-alias.ll index d785826..46a05ec 100644 --- a/test/Assembler/internal-protected-alias.ll +++ b/test/Assembler/internal-protected-alias.ll @@ -2,5 +2,5 @@ @global = global i32 0 -@alias = protected alias internal i32* @global +@alias = internal protected alias i32* @global ; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/invalid-uselistorder-function-between-blocks.ll b/test/Assembler/invalid-uselistorder-function-between-blocks.ll new file mode 100644 index 0000000..8f771e8 --- /dev/null +++ b/test/Assembler/invalid-uselistorder-function-between-blocks.ll @@ -0,0 +1,37 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s +; CHECK: error: expected uselistorder directive + +define i32 @f32(i32 %a, i32 %b, i32 %c, i32 %d) { +entry: + br label %first + +; <label 0>: + %eh = mul i32 %e, %1 + %sum = add i32 %eh, %ef + br label %preexit + +preexit: + %product = phi i32 [%ef, %first], [%sum, %0] + %backto0 = icmp slt i32 %product, -9 + br i1 %backto0, label %0, label %exit + +first: + %e = add i32 %a, 7 + %f = add i32 %b, 7 + %g = add i32 %c, 8 + %1 = add i32 %d, 8 + %ef = mul i32 %e, %f + %g1 = mul i32 %g, %1 + %goto0 = icmp slt i32 %g1, -9 + br i1 %goto0, label %0, label %preexit + +; uselistorder directives + uselistorder i32 7, { 1, 0 } + uselistorder i32 %1, { 1, 0 } + uselistorder i32 %e, { 1, 0 } + uselistorder label %0, { 1, 0 } + uselistorder label %preexit, { 1, 0 } + +exit: + ret i32 %product +} diff --git a/test/Assembler/invalid-uselistorder-function-missing-named.ll b/test/Assembler/invalid-uselistorder-function-missing-named.ll new file mode 100644 index 0000000..c682fbe --- /dev/null +++ b/test/Assembler/invalid-uselistorder-function-missing-named.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s +; CHECK: error: value has no uses +define void @foo() { + unreachable + uselistorder i32 %val, { 1, 0 } +} diff --git a/test/Assembler/invalid-uselistorder-function-missing-numbered.ll b/test/Assembler/invalid-uselistorder-function-missing-numbered.ll new file mode 100644 index 0000000..e3bf0e1 --- /dev/null +++ b/test/Assembler/invalid-uselistorder-function-missing-numbered.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s +; CHECK: error: value has no uses +define void @foo() { + unreachable + uselistorder i32 %1, { 1, 0 } +} diff --git a/test/Assembler/invalid-uselistorder-global-missing.ll b/test/Assembler/invalid-uselistorder-global-missing.ll new file mode 100644 index 0000000..92f9350 --- /dev/null +++ b/test/Assembler/invalid-uselistorder-global-missing.ll @@ -0,0 +1,3 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s +; CHECK: error: value has no uses +uselistorder i32* @global, { 1, 0 } diff --git a/test/Assembler/invalid-uselistorder-indexes-duplicated.ll b/test/Assembler/invalid-uselistorder-indexes-duplicated.ll new file mode 100644 index 0000000..e4affc5 --- /dev/null +++ b/test/Assembler/invalid-uselistorder-indexes-duplicated.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s +; CHECK: error: expected distinct uselistorder indexes in range [0, size) +@global = global i32 0 +@alias1 = alias i32* @global +@alias2 = alias i32* @global +@alias3 = alias i32* @global +uselistorder i32* @global, { 0, 0, 2 } diff --git a/test/Assembler/invalid-uselistorder-indexes-empty.ll b/test/Assembler/invalid-uselistorder-indexes-empty.ll new file mode 100644 index 0000000..82bbc97 --- /dev/null +++ b/test/Assembler/invalid-uselistorder-indexes-empty.ll @@ -0,0 +1,4 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s +; CHECK: error: value has no uses +@global = global i32 0 +uselistorder i32* @global, { 1, 0 } diff --git a/test/Assembler/invalid-uselistorder-indexes-one.ll b/test/Assembler/invalid-uselistorder-indexes-one.ll new file mode 100644 index 0000000..f5eac80 --- /dev/null +++ b/test/Assembler/invalid-uselistorder-indexes-one.ll @@ -0,0 +1,5 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s +; CHECK: error: value only has one use +@global = global i32 0 +@alias = alias i32* @global +uselistorder i32* @global, { 1, 0 } diff --git a/test/Assembler/invalid-uselistorder-indexes-ordered.ll b/test/Assembler/invalid-uselistorder-indexes-ordered.ll new file mode 100644 index 0000000..7bdc400 --- /dev/null +++ b/test/Assembler/invalid-uselistorder-indexes-ordered.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s +; CHECK: error: expected uselistorder indexes to change the order +@global = global i32 0 +@alias1 = alias i32* @global +@alias2 = alias i32* @global +@alias3 = alias i32* @global +uselistorder i32* @global, { 0, 1, 2 } diff --git a/test/Assembler/invalid-uselistorder-indexes-range.ll b/test/Assembler/invalid-uselistorder-indexes-range.ll new file mode 100644 index 0000000..fc97aca --- /dev/null +++ b/test/Assembler/invalid-uselistorder-indexes-range.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s +; CHECK: error: expected distinct uselistorder indexes in range [0, size) +@global = global i32 0 +@alias1 = alias i32* @global +@alias2 = alias i32* @global +@alias3 = alias i32* @global +uselistorder i32* @global, { 0, 3, 1 } diff --git a/test/Assembler/invalid-uselistorder-indexes-toofew.ll b/test/Assembler/invalid-uselistorder-indexes-toofew.ll new file mode 100644 index 0000000..88a76fc --- /dev/null +++ b/test/Assembler/invalid-uselistorder-indexes-toofew.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s +; CHECK: error: wrong number of indexes, expected 3 +@global = global i32 0 +@alias1 = alias i32* @global +@alias2 = alias i32* @global +@alias3 = alias i32* @global +uselistorder i32* @global, { 1, 0 } diff --git a/test/Assembler/invalid-uselistorder-indexes-toomany.ll b/test/Assembler/invalid-uselistorder-indexes-toomany.ll new file mode 100644 index 0000000..a2cf3da --- /dev/null +++ b/test/Assembler/invalid-uselistorder-indexes-toomany.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s +; CHECK: error: wrong number of indexes, expected 2 +@global = global i32 0 +@alias1 = alias i32* @global +@alias2 = alias i32* @global +uselistorder i32* @global, { 1, 0, 2 } diff --git a/test/Assembler/invalid-uselistorder-type.ll b/test/Assembler/invalid-uselistorder-type.ll new file mode 100644 index 0000000..e426a7d --- /dev/null +++ b/test/Assembler/invalid-uselistorder-type.ll @@ -0,0 +1,4 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s +; CHECK: error: '@global' defined with type 'i32*' +@global = global i32 0 +uselistorder i31* @global, { 1, 0 } diff --git a/test/Assembler/invalid-uselistorder_bb-missing-bb.ll b/test/Assembler/invalid-uselistorder_bb-missing-bb.ll new file mode 100644 index 0000000..bd12faa --- /dev/null +++ b/test/Assembler/invalid-uselistorder_bb-missing-bb.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s +; CHECK: error: invalid basic block in uselistorder_bb +define void @foo() { + unreachable +} +uselistorder_bb @foo, %bb, { 1, 0 } diff --git a/test/Assembler/invalid-uselistorder_bb-missing-body.ll b/test/Assembler/invalid-uselistorder_bb-missing-body.ll new file mode 100644 index 0000000..0fbc3a8 --- /dev/null +++ b/test/Assembler/invalid-uselistorder_bb-missing-body.ll @@ -0,0 +1,4 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s +; CHECK: error: invalid declaration in uselistorder_bb +declare void @foo() +uselistorder_bb @foo, %bb, { 1, 0 } diff --git a/test/Assembler/invalid-uselistorder_bb-missing-func.ll b/test/Assembler/invalid-uselistorder_bb-missing-func.ll new file mode 100644 index 0000000..5a1466f --- /dev/null +++ b/test/Assembler/invalid-uselistorder_bb-missing-func.ll @@ -0,0 +1,3 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s +; CHECK: error: invalid function forward reference in uselistorder_bb +uselistorder_bb @foo, %bb, { 1, 0 } diff --git a/test/Assembler/invalid-uselistorder_bb-not-bb.ll b/test/Assembler/invalid-uselistorder_bb-not-bb.ll new file mode 100644 index 0000000..e59e754 --- /dev/null +++ b/test/Assembler/invalid-uselistorder_bb-not-bb.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s +; CHECK: error: expected basic block in uselistorder_bb +define i32 @foo(i32 %arg) { + ret i32 %arg +} +uselistorder_bb @foo, %arg, { 1, 0 } diff --git a/test/Assembler/invalid-uselistorder_bb-not-func.ll b/test/Assembler/invalid-uselistorder_bb-not-func.ll new file mode 100644 index 0000000..080ddc1 --- /dev/null +++ b/test/Assembler/invalid-uselistorder_bb-not-func.ll @@ -0,0 +1,4 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s +; CHECK: error: expected function name in uselistorder_bb +@global = global i1 0 +uselistorder_bb @global, %bb, { 1, 0 } diff --git a/test/Assembler/invalid-uselistorder_bb-numbered.ll b/test/Assembler/invalid-uselistorder_bb-numbered.ll new file mode 100644 index 0000000..d7d170f --- /dev/null +++ b/test/Assembler/invalid-uselistorder_bb-numbered.ll @@ -0,0 +1,11 @@ +; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s +; CHECK: error: invalid numeric label in uselistorder_bb + +@ba1 = constant i8* blockaddress (@foo, %1) + +define void @foo() { + br label %1 + unreachable +} + +uselistorder_bb @foo, %1, { 1, 0 } diff --git a/test/Assembler/metadata.ll b/test/Assembler/metadata.ll index 56888fd..f6e619d 100644 --- a/test/Assembler/metadata.ll +++ b/test/Assembler/metadata.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; CHECK: @test ; CHECK: ret void, !bar !1, !foo !0 diff --git a/test/Assembler/musttail-invalid-1.ll b/test/Assembler/musttail-invalid-1.ll new file mode 100644 index 0000000..b123a91 --- /dev/null +++ b/test/Assembler/musttail-invalid-1.ll @@ -0,0 +1,14 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +; Check the error message on using ", ..." when we can't actually forward +; varargs. + +%struct.A = type { i32 } + +declare i8* @f(i8*, ...) + +define i8* @f_thunk(i8* %this) { + %rv = musttail call i8* (i8*, ...)* @f(i8* %this, ...) +; CHECK: error: unexpected ellipsis in argument list for musttail call in non-varargs function + ret i8* %rv +} diff --git a/test/Assembler/musttail-invalid-2.ll b/test/Assembler/musttail-invalid-2.ll new file mode 100644 index 0000000..3bcb51f --- /dev/null +++ b/test/Assembler/musttail-invalid-2.ll @@ -0,0 +1,13 @@ +; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s + +; Check the error message on skipping ", ..." at the end of a musttail call argument list. + +%struct.A = type { i32 } + +declare i8* @f(i8*, ...) + +define i8* @f_thunk(i8* %this, ...) { + %rv = musttail call i8* (i8*, ...)* @f(i8* %this) +; CHECK: error: expected '...' at end of argument list for musttail call in varargs function + ret i8* %rv +} diff --git a/test/Assembler/musttail.ll b/test/Assembler/musttail.ll new file mode 100644 index 0000000..6e2a9b2 --- /dev/null +++ b/test/Assembler/musttail.ll @@ -0,0 +1,14 @@ +; RUN: llvm-as < %s | llvm-dis | FileCheck %s + +; Check that the ellipsis round trips. + +%struct.A = type { i32 } + +declare i8* @f(i8*, ...) + +define i8* @f_thunk(i8* %this, ...) { + %rv = musttail call i8* (i8*, ...)* @f(i8* %this, ...) + ret i8* %rv +} +; CHECK-LABEL: define i8* @f_thunk(i8* %this, ...) +; CHECK: %rv = musttail call i8* (i8*, ...)* @f(i8* %this, ...) diff --git a/test/Assembler/named-metadata.ll b/test/Assembler/named-metadata.ll index db72810..954c189 100644 --- a/test/Assembler/named-metadata.ll +++ b/test/Assembler/named-metadata.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s !0 = metadata !{metadata !"zero"} !1 = metadata !{metadata !"one"} diff --git a/test/Assembler/numbered-values.ll b/test/Assembler/numbered-values.ll index 2439c83..70b6377 100644 --- a/test/Assembler/numbered-values.ll +++ b/test/Assembler/numbered-values.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis +; RUN: verify-uselistorder %s ; PR2480 define i32 @test(i32 %X) nounwind { diff --git a/test/Assembler/private-hidden-alias.ll b/test/Assembler/private-hidden-alias.ll index 58be92a..2e770e5 100644 --- a/test/Assembler/private-hidden-alias.ll +++ b/test/Assembler/private-hidden-alias.ll @@ -2,5 +2,5 @@ @global = global i32 0 -@alias = hidden alias private i32* @global +@alias = private hidden alias i32* @global ; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/private-protected-alias.ll b/test/Assembler/private-protected-alias.ll index a72c248..f1824a2 100644 --- a/test/Assembler/private-protected-alias.ll +++ b/test/Assembler/private-protected-alias.ll @@ -2,5 +2,5 @@ @global = global i32 0 -@alias = protected alias private i32* @global +@alias = private protected alias i32* @global ; CHECK: symbol with local linkage must have default visibility diff --git a/test/Assembler/select.ll b/test/Assembler/select.ll index 2d3f412..fe4677a 100644 --- a/test/Assembler/select.ll +++ b/test/Assembler/select.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as %s -o /dev/null +; RUN: verify-uselistorder %s define i32 @test(i1 %C, i32 %V1, i32 %V2) { diff --git a/test/Assembler/tls-models.ll b/test/Assembler/tls-models.ll index 42f2496..fbc0777 100644 --- a/test/Assembler/tls-models.ll +++ b/test/Assembler/tls-models.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; CHECK: @a = thread_local global i32 0 ; CHECK: @b = thread_local(localdynamic) global i32 0 diff --git a/test/Assembler/unnamed-addr.ll b/test/Assembler/unnamed-addr.ll index 35b3b39..304e544 100644 --- a/test/Assembler/unnamed-addr.ll +++ b/test/Assembler/unnamed-addr.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s %struct.foobar = type { i32 } diff --git a/test/Assembler/unnamed.ll b/test/Assembler/unnamed.ll index fb4fa62..099a15a 100644 --- a/test/Assembler/unnamed.ll +++ b/test/Assembler/unnamed.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis +; RUN: verify-uselistorder %s 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" diff --git a/test/Assembler/upgrade-loop-metadata.ll b/test/Assembler/upgrade-loop-metadata.ll index f664bdf..7c5a580 100644 --- a/test/Assembler/upgrade-loop-metadata.ll +++ b/test/Assembler/upgrade-loop-metadata.ll @@ -5,6 +5,7 @@ ; ; RUN: llvm-as < %s | llvm-dis | FileCheck %s ; RUN: opt -S < %s | FileCheck %s +; RUN: verify-uselistorder %s define void @_Z28loop_with_vectorize_metadatav() { entry: @@ -30,7 +31,7 @@ for.end: ; preds = %for.cond ret void } -; CHECK: !{metadata !"llvm.loop.vectorize.unroll", i32 4} +; CHECK: !{metadata !"llvm.loop.interleave.count", i32 4} ; CHECK: !{metadata !"llvm.loop.vectorize.width", i32 8} ; CHECK: !{metadata !"llvm.loop.vectorize.enable", i1 true} diff --git a/test/Assembler/uselistorder.ll b/test/Assembler/uselistorder.ll new file mode 100644 index 0000000..be5ee70 --- /dev/null +++ b/test/Assembler/uselistorder.ll @@ -0,0 +1,56 @@ +; RUN: llvm-as < %s -disable-output 2>&1 | FileCheck %s -allow-empty +; CHECK-NOT: error +; CHECK-NOT: warning +; RUN: verify-uselistorder < %s + +@a = global [4 x i1] [i1 0, i1 1, i1 0, i1 1] +@b = alias i1* getelementptr ([4 x i1]* @a, i64 0, i64 2) + +; Check use-list order of constants used by globals. +@glob1 = global i5 7 +@glob2 = global i5 7 +@glob3 = global i5 7 + +define i32 @f32(i32 %a, i32 %b, i32 %c, i32 %d) { +entry: + br label %first + +; <label 0>: + %eh = mul i32 %e, %1 + %sum = add i32 %eh, %ef + br label %preexit + +preexit: + %product = phi i32 [%ef, %first], [%sum, %0] + %backto0 = icmp slt i32 %product, -9 + br i1 %backto0, label %0, label %exit + +exit: + ret i32 %product + +first: + %e = add i32 %a, 7 + %f = add i32 %b, 7 + %g = add i32 %c, 8 + %1 = add i32 %d, 8 + %ef = mul i32 %e, %f + %g1 = mul i32 %g, %1 + %goto0 = icmp slt i32 %g1, -9 + br i1 %goto0, label %0, label %preexit + +; uselistorder directives + uselistorder i32 7, { 1, 0 } + uselistorder i32 %1, { 1, 0 } + uselistorder i32 %e, { 1, 0 } + uselistorder label %0, { 1, 0 } + uselistorder label %preexit, { 1, 0 } +} + +define i1 @loada() { +entry: + %a = load i1* getelementptr ([4 x i1]* @a, i64 0, i64 2) + ret i1 %a +} + +uselistorder i5 7, { 1, 0, 2 } +uselistorder i1* getelementptr ([4 x i1]* @a, i64 0, i64 2), { 1, 0 } diff --git a/test/Assembler/uselistorder_bb.ll b/test/Assembler/uselistorder_bb.ll new file mode 100644 index 0000000..11ae57b --- /dev/null +++ b/test/Assembler/uselistorder_bb.ll @@ -0,0 +1,42 @@ +; RUN: llvm-as < %s -disable-output 2>&1 | FileCheck %s -allow-empty +; CHECK-NOT: error +; CHECK-NOT: warning +; RUN: verify-uselistorder < %s + +@ba1 = constant i8* blockaddress (@bafunc1, %bb) +@ba2 = constant i8* getelementptr (i8* blockaddress (@bafunc2, %bb), i61 0) +@ba3 = constant i8* getelementptr (i8* blockaddress (@bafunc2, %bb), i61 0) + +define i8* @babefore() { + ret i8* getelementptr (i8* blockaddress (@bafunc2, %bb), i61 0) +bb1: + ret i8* blockaddress (@bafunc1, %bb) +bb2: + ret i8* blockaddress (@bafunc3, %bb) +} +define void @bafunc1() { + br label %bb +bb: + unreachable +} +define void @bafunc2() { + br label %bb +bb: + unreachable +} +define void @bafunc3() { + br label %bb +bb: + unreachable +} +define i8* @baafter() { + ret i8* blockaddress (@bafunc2, %bb) +bb1: + ret i8* blockaddress (@bafunc1, %bb) +bb2: + ret i8* blockaddress (@bafunc3, %bb) +} + +uselistorder_bb @bafunc1, %bb, { 1, 0 } +uselistorder_bb @bafunc2, %bb, { 1, 0 } +uselistorder_bb @bafunc3, %bb, { 1, 0 } diff --git a/test/Assembler/vbool-cmp.ll b/test/Assembler/vbool-cmp.ll index e652d2f..6bbd5c8 100644 --- a/test/Assembler/vbool-cmp.ll +++ b/test/Assembler/vbool-cmp.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; Rudimentary test of fcmp/icmp on vectors returning vector of bool ; CHECK: @ffoo diff --git a/test/Assembler/vector-cmp.ll b/test/Assembler/vector-cmp.ll index 6e3894c..dc55494 100644 --- a/test/Assembler/vector-cmp.ll +++ b/test/Assembler/vector-cmp.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; 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" diff --git a/test/Assembler/vector-select.ll b/test/Assembler/vector-select.ll index ae8358a..59692d6 100644 --- a/test/Assembler/vector-select.ll +++ b/test/Assembler/vector-select.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; Rudimentary test of select on vectors returning vector of bool ; CHECK: @foo diff --git a/test/Assembler/vector-shift.ll b/test/Assembler/vector-shift.ll index 6a6531b..d4351a8 100644 --- a/test/Assembler/vector-shift.ll +++ b/test/Assembler/vector-shift.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; CHECK: @foo ; CHECK: shl diff --git a/test/Assembler/x86mmx.ll b/test/Assembler/x86mmx.ll index 732d3be..608347e 100644 --- a/test/Assembler/x86mmx.ll +++ b/test/Assembler/x86mmx.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s ; Basic smoke test for x86_mmx type. ; CHECK: define x86_mmx @sh16 |