diff options
author | Pirama Arumuga Nainar <pirama@google.com> | 2015-04-08 08:55:49 -0700 |
---|---|---|
committer | Pirama Arumuga Nainar <pirama@google.com> | 2015-04-09 15:04:38 -0700 |
commit | 4c5e43da7792f75567b693105cc53e3f1992ad98 (patch) | |
tree | 1b2c9792582e12f5af0b1512e3094425f0dc0df9 /test/Assembler | |
parent | c75239e6119d0f9a74c57099d91cbc9bde56bf33 (diff) | |
download | external_llvm-4c5e43da7792f75567b693105cc53e3f1992ad98.zip external_llvm-4c5e43da7792f75567b693105cc53e3f1992ad98.tar.gz external_llvm-4c5e43da7792f75567b693105cc53e3f1992ad98.tar.bz2 |
Update aosp/master llvm for rebase to r233350
Change-Id: I07d935f8793ee8ec6b7da003f6483046594bca49
Diffstat (limited to 'test/Assembler')
81 files changed, 326 insertions, 268 deletions
diff --git a/test/Assembler/2002-04-29-NameBinding.ll b/test/Assembler/2002-04-29-NameBinding.ll index 960209b..c387c47 100644 --- a/test/Assembler/2002-04-29-NameBinding.ll +++ b/test/Assembler/2002-04-29-NameBinding.ll @@ -13,7 +13,7 @@ define i32 @createtask() { %v1 = alloca i32 ;; Alloca should have one use! - %reg112 = load i32* %v1 ;; This load should not use the global! + %reg112 = load i32, i32* %v1 ;; This load should not use the global! ret i32 %reg112 } diff --git a/test/Assembler/2002-08-15-ConstantExprProblem.ll b/test/Assembler/2002-08-15-ConstantExprProblem.ll index 343a104..47a3f9c 100644 --- a/test/Assembler/2002-08-15-ConstantExprProblem.ll +++ b/test/Assembler/2002-08-15-ConstantExprProblem.ll @@ -8,7 +8,7 @@ define i8* @test() { 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 = phi i8* [ getelementptr ([12 x i8], [12 x i8]* @.LC0, i64 0, i64 0), %0 ], [ null, %BB2 ] ; <i8*> [#uses=1] ret i8* %ret BB2: ; No predecessors! diff --git a/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll b/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll index 6bbe0cf..cbed332 100644 --- a/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll +++ b/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll @@ -4,6 +4,6 @@ @.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) + ret i8* getelementptr ([12 x i8], [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 index b78d858..d43fe97 100644 --- a/test/Assembler/2002-08-16-ConstExprInlined.ll +++ b/test/Assembler/2002-08-16-ConstExprInlined.ll @@ -18,6 +18,6 @@ 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] + %reg211 = call i32 @puts( i8* getelementptr ([4 x i8], [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 index 0722885..1fd6bb6 100644 --- a/test/Assembler/2002-08-19-BytecodeReader.ll +++ b/test/Assembler/2002-08-19-BytecodeReader.ll @@ -10,9 +10,9 @@ @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] + %reg1321 = getelementptr %CHESS_POSITION, %CHESS_POSITION* @search, i64 0, i32 1 ; <i32*> [#uses=1] + %reg114 = load i32, i32* %reg1321 ; <i32> [#uses=0] + %reg1801 = getelementptr %CHESS_POSITION, %CHESS_POSITION* @search, i64 0, i32 0 ; <i32*> [#uses=1] + %reg182 = load i32, i32* %reg1801 ; <i32> [#uses=0] ret void } diff --git a/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll b/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll index 911f0ff..435992c 100644 --- a/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll +++ b/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll @@ -4,7 +4,7 @@ @.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.54 = load i8, i8* getelementptr ([6 x i8], [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 diff --git a/test/Assembler/2004-01-11-getelementptrfolding.ll b/test/Assembler/2004-01-11-getelementptrfolding.ll index 188a95f..def8e37 100644 --- a/test/Assembler/2004-01-11-getelementptrfolding.ll +++ b/test/Assembler/2004-01-11-getelementptrfolding.ll @@ -7,7 +7,7 @@ @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) + store i16 0, i16* getelementptr ([2908 x %struct.TTriangleItem], [2908 x %struct.TTriangleItem]* @data_triangleItems, i64 0, i64 0, i32 2, i64 0, i32 0) ret void } diff --git a/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll b/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll index a86fe63..04d5961 100644 --- a/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll +++ b/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll @@ -2,10 +2,10 @@ ; RUN: verify-uselistorder %s 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] + %W = getelementptr { float, i32 }, { float, i32 }* %X, i32 20, i32 1 ; <i32*> [#uses=0] + %X.upgrd.1 = getelementptr { float, i32 }, { float, i32 }* %X, i64 20, i32 1 ; <i32*> [#uses=0] + %Y = getelementptr { float, i32 }, { float, i32 }* %X, i64 20, i32 1 ; <i32*> [#uses=1] + %Z = getelementptr { float, i32 }, { 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 index 090599a..2fc0ae2 100644 --- a/test/Assembler/2004-06-07-VerifierBug.ll +++ b/test/Assembler/2004-06-07-VerifierBug.ll @@ -6,7 +6,7 @@ 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] + %tmp.4.i9 = getelementptr i32, i32* null, i32 %tmp.5.i10 ; <i32*> [#uses=1] + %tmp.5.i10 = load i32, i32* %tmp.4.i9 ; <i32> [#uses=1] br label %loop } diff --git a/test/Assembler/2007-01-05-Cmp-ConstExpr.ll b/test/Assembler/2007-01-05-Cmp-ConstExpr.ll index 54a4372..8119629 100644 --- a/test/Assembler/2007-01-05-Cmp-ConstExpr.ll +++ b/test/Assembler/2007-01-05-Cmp-ConstExpr.ll @@ -6,9 +6,9 @@ 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 + %tmp65 = getelementptr i8*, i8** %argv, i32 1 ; <i8**> [#uses=1] + %tmp66 = load i8*, i8** %tmp65 ; <i8*> [#uses=0] + br i1 icmp ne (i32 sub (i32 ptrtoint (i8* getelementptr ([4 x i8], [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 diff --git a/test/Assembler/2007-04-20-AlignedLoad.ll b/test/Assembler/2007-04-20-AlignedLoad.ll index bcf65fd..1e8850a 100644 --- a/test/Assembler/2007-04-20-AlignedLoad.ll +++ b/test/Assembler/2007-04-20-AlignedLoad.ll @@ -3,6 +3,6 @@ define i32 @test(i32* %arg) { entry: - %tmp2 = load i32* %arg, align 1024 ; <i32> [#uses=1] + %tmp2 = load i32, i32* %arg, align 1024 ; <i32> [#uses=1] ret i32 %tmp2 } diff --git a/test/Assembler/2007-12-11-AddressSpaces.ll b/test/Assembler/2007-12-11-AddressSpaces.ll index f860f57..5155c6b 100644 --- a/test/Assembler/2007-12-11-AddressSpaces.ll +++ b/test/Assembler/2007-12-11-AddressSpaces.ll @@ -12,15 +12,15 @@ 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 + %tmp1 = load i32 addrspace(33)*, i32 addrspace(33)* addrspace(42)* getelementptr (%struct.mystruct, %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, %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] + %tmp1 = load i32 addrspace(11)* addrspace(22)*, 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] + %tmp5 = load i32 addrspace(11)*, i32 addrspace(11)* addrspace(22)* %tmp1, align 4 ; <i32 addrspace(11)*> [#uses=1] ret i32 addrspace(11)* %tmp5 } diff --git a/test/Assembler/2009-07-24-ZeroArgGEP.ll b/test/Assembler/2009-07-24-ZeroArgGEP.ll index 92f4d59..cd8b5d9 100644 --- a/test/Assembler/2009-07-24-ZeroArgGEP.ll +++ b/test/Assembler/2009-07-24-ZeroArgGEP.ll @@ -2,5 +2,5 @@ ; RUN: verify-uselistorder %s @foo = global i32 0 -@bar = constant i32* getelementptr(i32* @foo) +@bar = constant i32* getelementptr(i32, i32* @foo) diff --git a/test/Assembler/2010-02-05-FunctionLocalMetadataBecomesNull.ll b/test/Assembler/2010-02-05-FunctionLocalMetadataBecomesNull.ll index 50ad32e..2dd4743 100644 --- a/test/Assembler/2010-02-05-FunctionLocalMetadataBecomesNull.ll +++ b/test/Assembler/2010-02-05-FunctionLocalMetadataBecomesNull.ll @@ -7,15 +7,15 @@ target triple = "x86_64-apple-darwin10.2" %struct.anon = type { i32, i32 } %struct.test = type { i64, %struct.anon, %struct.test* } -@TestArrayPtr = global %struct.test* getelementptr inbounds ([10 x %struct.test]* @TestArray, i64 0, i64 3) ; <%struct.test**> [#uses=1] +@TestArrayPtr = global %struct.test* getelementptr inbounds ([10 x %struct.test], [10 x %struct.test]* @TestArray, i64 0, i64 3) ; <%struct.test**> [#uses=1] @TestArray = common global [10 x %struct.test] zeroinitializer, align 32 ; <[10 x %struct.test]*> [#uses=2] define i32 @main() nounwind readonly { %diff1 = alloca i64 ; <i64*> [#uses=2] ; CHECK: call void @llvm.dbg.value(metadata i64 72, - call void @llvm.dbg.declare(metadata i64* %diff1, metadata !0, metadata !{!"0x102"}) + call void @llvm.dbg.declare(metadata i64* %diff1, metadata !0, metadata !MDExpression()) store i64 72, i64* %diff1, align 8 - %v1 = load %struct.test** @TestArrayPtr, align 8 ; <%struct.test*> [#uses=1] + %v1 = load %struct.test*, %struct.test** @TestArrayPtr, align 8 ; <%struct.test*> [#uses=1] %v2 = ptrtoint %struct.test* %v1 to i64 ; <i64> [#uses=1] %v3 = sub i64 %v2, ptrtoint ([10 x %struct.test]* @TestArray to i64) ; <i64> [#uses=1] store i64 %v3, i64* %diff1, align 8 @@ -25,15 +25,15 @@ define i32 @main() nounwind readonly { declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !7 = !{!1} -!6 = !{!"0x11\0012\00clang version 3.0 (trunk 131941)\001\00\000\00\000", !8, !9, !9, !7, null, null} ; [ DW_TAG_compile_unit ] -!0 = !{!"0x100\00c\002\000", !1, !2, !5} ; [ DW_TAG_auto_variable ] -!1 = !{!"0x2e\00main\00main\00\001\000\001\000\006\00256\000\001", !8, !2, !3, null, i32 ()* @main, null, null, null} ; [ DW_TAG_subprogram ] -!2 = !{!"0x29", !8} ; [ DW_TAG_file_type ] -!3 = !{!"0x15\00\000\000\000\000\000\000", !8, !2, null, !4, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!6 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 131941)", isOptimized: true, emissionKind: 0, file: !8, enums: !9, retainedTypes: !9, subprograms: !7) +!0 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "c", line: 2, scope: !1, file: !2, type: !5) +!1 = !MDSubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !8, scope: !2, type: !3, function: i32 ()* @main) +!2 = !MDFile(filename: "/d/j/debug-test.c", directory: "/Volumes/Data/b") +!3 = !MDSubroutineType(types: !4) !4 = !{!5} -!5 = !{!"0x24\00int\000\0032\0032\000\000\005", null, !6} ; [ DW_TAG_base_type ] -!8 = !{!"/d/j/debug-test.c", !"/Volumes/Data/b"} +!5 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!8 = !MDFile(filename: "/d/j/debug-test.c", directory: "/Volumes/Data/b") !9 = !{i32 0} !llvm.module.flags = !{!10} -!10 = !{i32 1, !"Debug Info Version", i32 2} +!10 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Assembler/ConstantExprFold.ll b/test/Assembler/ConstantExprFold.ll index dc41331..3314f8c 100644 --- a/test/Assembler/ConstantExprFold.ll +++ b/test/Assembler/ConstantExprFold.ll @@ -19,11 +19,11 @@ global i64* inttoptr (i64 xor (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; %Ty = type { i32, i32 } @B = external global %Ty -global i1 icmp slt (i64* @A, i64* getelementptr (i64* @A, i64 1)) ; true -global i1 icmp ult (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 slt (i64* @A, i64* getelementptr (i64, i64* @A, i64 1)) ; true +global i1 icmp ult (i64* @A, i64* getelementptr (i64, i64* @A, i64 1)) ; true +global i1 icmp slt (i64* @A, i64* getelementptr (i64, i64* @A, i64 0)) ; false +global i1 icmp slt (i32* getelementptr (%Ty, %Ty* @B, i64 0, i32 0), + i32* getelementptr (%Ty, %Ty* @B, i64 0, i32 1)) ; true ;global i1 icmp ne (i64* @A, i64* bitcast (%Ty* @B to i64*)) ; true ; PR2206 diff --git a/test/Assembler/ConstantExprNoFold.ll b/test/Assembler/ConstantExprNoFold.ll index 83236d5..38f8cbb 100644 --- a/test/Assembler/ConstantExprNoFold.ll +++ b/test/Assembler/ConstantExprNoFold.ll @@ -14,21 +14,21 @@ target datalayout = "p:32:32" ; icmp should return true. It's not valid to *dereference* in @B from a pointer ; based on @A, but icmp isn't a dereference. -; CHECK: @C = global i1 icmp eq (i64* getelementptr inbounds (i64* @A, i64 1), i64* @B) -@C = global i1 icmp eq (i64* getelementptr inbounds (i64* @A, i64 1), i64* @B) +; CHECK: @C = global i1 icmp eq (i64* getelementptr inbounds (i64, i64* @A, i64 1), i64* @B) +@C = global i1 icmp eq (i64* getelementptr inbounds (i64, i64* @A, i64 1), i64* @B) ; Don't fold this completely away either. In theory this could be simplified ; to only use a gep on one side of the icmp though. -; CHECK: @D = global i1 icmp eq (i64* getelementptr inbounds (i64* @A, i64 1), i64* getelementptr inbounds (i64* @B, i64 2)) -@D = global i1 icmp eq (i64* getelementptr inbounds (i64* @A, i64 1), i64* getelementptr inbounds (i64* @B, i64 2)) +; CHECK: @D = global i1 icmp eq (i64* getelementptr inbounds (i64, i64* @A, i64 1), i64* getelementptr inbounds (i64, i64* @B, i64 2)) +@D = global i1 icmp eq (i64* getelementptr inbounds (i64, i64* @A, i64 1), i64* getelementptr inbounds (i64, i64* @B, i64 2)) ; 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) +; CHECK: @weak.gep = global i32* getelementptr (i32, i32* @weak, i32 1) +@weak.gep = global i32* getelementptr (i32, i32* @weak, i32 1) @weak = extern_weak global i32 ; An object with weak linkage cannot have it's identity determined at compile time. @@ -43,8 +43,8 @@ target datalayout = "p:32:32" @empty.cmp = global i1 icmp eq ([0 x i8]* @empty.1, [0 x i8]* @empty.2) ; Don't add an inbounds on @glob.a3, since it's not inbounds. -; CHECK: @glob.a3 = alias getelementptr (i32* @glob.a2, i32 1) +; CHECK: @glob.a3 = alias getelementptr (i32, 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.a3 = alias getelementptr (i32, i32* @glob.a2, i32 1) +@glob.a2 = alias getelementptr (i32, i32* @glob.a1, i32 1) @glob.a1 = alias i32* @glob diff --git a/test/Assembler/alias-use-list-order.ll b/test/Assembler/alias-use-list-order.ll index d29fd6e..c72bad2 100644 --- a/test/Assembler/alias-use-list-order.ll +++ b/test/Assembler/alias-use-list-order.ll @@ -2,10 +2,10 @@ ; 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) +@alias.ref1 = global i32* getelementptr inbounds (i32, i32* @alias, i64 1) +@alias.ref2 = global i32* getelementptr inbounds (i32, 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) +@alias.ref3 = alias i32* getelementptr inbounds (i32, i32* @alias, i64 1) +@alias.ref4 = alias i32* getelementptr inbounds (i32, i32* @alias, i64 1) diff --git a/test/Assembler/align-inst-load.ll b/test/Assembler/align-inst-load.ll index 3586be2..75fcd3e 100644 --- a/test/Assembler/align-inst-load.ll +++ b/test/Assembler/align-inst-load.ll @@ -1,6 +1,6 @@ ; RUN: not llvm-as %s -o /dev/null 2>/dev/null define void @foo() { - load i1* %p, align 1073741824 + load i1, i1* %p, align 1073741824 ret void } diff --git a/test/Assembler/align-inst.ll b/test/Assembler/align-inst.ll index 1952fbc..028da39 100644 --- a/test/Assembler/align-inst.ll +++ b/test/Assembler/align-inst.ll @@ -5,7 +5,7 @@ define void @foo() { %p = alloca i1, align 536870912 - load i1* %p, align 536870912 + load i1, i1* %p, align 536870912 store i1 false, i1* %p, align 536870912 ret void } diff --git a/test/Assembler/alloca-size-one.ll b/test/Assembler/alloca-size-one.ll new file mode 100644 index 0000000..fc5ee34 --- /dev/null +++ b/test/Assembler/alloca-size-one.ll @@ -0,0 +1,11 @@ +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s + +define void @foo() { +entry: +; CHECK: %alloc32 = alloca i1, align 8 +; CHECK: %alloc64 = alloca i1, i64 1, align 8 + %alloc32 = alloca i1, i32 1, align 8 + %alloc64 = alloca i1, i64 1, align 8 + unreachable +} diff --git a/test/Assembler/atomic.ll b/test/Assembler/atomic.ll index 0356f5f..148b95d 100644 --- a/test/Assembler/atomic.ll +++ b/test/Assembler/atomic.ll @@ -3,10 +3,10 @@ ; Basic smoke test for atomic operations. define void @f(i32* %x) { - ; CHECK: load atomic i32* %x unordered, align 4 - load atomic i32* %x unordered, align 4 - ; CHECK: load atomic volatile i32* %x singlethread acquire, align 4 - load atomic volatile i32* %x singlethread acquire, align 4 + ; CHECK: load atomic i32, i32* %x unordered, align 4 + load atomic i32, i32* %x unordered, align 4 + ; CHECK: load atomic volatile i32, i32* %x singlethread acquire, align 4 + load atomic volatile i32, i32* %x singlethread acquire, align 4 ; CHECK: store atomic i32 3, i32* %x release, align 4 store atomic i32 3, i32* %x release, align 4 ; CHECK: store atomic volatile i32 3, i32* %x singlethread monotonic, align 4 diff --git a/test/Assembler/auto_upgrade_intrinsics.ll b/test/Assembler/auto_upgrade_intrinsics.ll index f16e5fe..9a66a0d 100644 --- a/test/Assembler/auto_upgrade_intrinsics.ll +++ b/test/Assembler/auto_upgrade_intrinsics.ll @@ -55,6 +55,6 @@ define i32 @test.objectsize() { ; CHECK-LABEL: @test.objectsize( ; CHECK: @llvm.objectsize.i32.p0i8 ; CHECK-DAG: declare i32 @llvm.objectsize.i32.p0i8 - %s = call i32 @llvm.objectsize.i32(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i1 false) + %s = call i32 @llvm.objectsize.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i1 false) ret i32 %s } diff --git a/test/Assembler/debug-info.ll b/test/Assembler/debug-info.ll index 435b892..7103ed2 100644 --- a/test/Assembler/debug-info.ll +++ b/test/Assembler/debug-info.ll @@ -20,12 +20,12 @@ !5 = !MDEnumerator(name: "negeight", value: -8) !6 = !MDEnumerator(name: "", value: 0) -; CHECK-NEXT: !6 = !MDBasicType(tag: DW_TAG_base_type, name: "name", size: 1, align: 2, encoding: DW_ATE_unsigned_char) +; CHECK-NEXT: !6 = !MDBasicType(name: "name", size: 1, align: 2, encoding: DW_ATE_unsigned_char) ; CHECK-NEXT: !7 = !MDBasicType(tag: DW_TAG_unspecified_type, name: "decltype(nullptr)") -; CHECK-NEXT: !8 = !MDBasicType(tag: DW_TAG_base_type) +; CHECK-NEXT: !8 = !MDBasicType() !7 = !MDBasicType(tag: DW_TAG_base_type, name: "name", size: 1, align: 2, encoding: DW_ATE_unsigned_char) !8 = !MDBasicType(tag: DW_TAG_unspecified_type, name: "decltype(nullptr)") -!9 = !MDBasicType(tag: DW_TAG_base_type) +!9 = !MDBasicType() !10 = !MDBasicType(tag: DW_TAG_base_type, name: "", size: 0, align: 0, encoding: 0) ; CHECK-NEXT: !9 = distinct !{} @@ -41,22 +41,22 @@ !15 = !MDDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 32, align: 32) ; CHECK-NEXT: !14 = !MDCompositeType(tag: DW_TAG_structure_type, name: "MyType", file: !10, line: 2, size: 32, align: 32, identifier: "MangledMyType") -; CHECK-NEXT: !15 = distinct !MDCompositeType(tag: DW_TAG_structure_type, name: "Base", file: !10, line: 3, scope: !14, size: 128, align: 32, offset: 64, flags: DIFlagPublic, elements: !16, runtimeLang: DW_LANG_C_plus_plus_11, vtableHolder: !15, templateParams: !18, identifier: "MangledBase") +; CHECK-NEXT: !15 = distinct !MDCompositeType(tag: DW_TAG_structure_type, name: "Base", scope: !14, file: !10, line: 3, size: 128, align: 32, offset: 64, flags: DIFlagPublic, elements: !16, runtimeLang: DW_LANG_C_plus_plus_11, vtableHolder: !15, templateParams: !18, identifier: "MangledBase") ; CHECK-NEXT: !16 = !{!17} -; CHECK-NEXT: !17 = !MDDerivedType(tag: DW_TAG_member, name: "field", file: !10, line: 4, scope: !15, baseType: !6, size: 32, align: 32, offset: 32, flags: DIFlagPublic) +; CHECK-NEXT: !17 = !MDDerivedType(tag: DW_TAG_member, name: "field", scope: !15, file: !10, line: 4, baseType: !6, size: 32, align: 32, offset: 32, flags: DIFlagPublic) ; CHECK-NEXT: !18 = !{!6} -; CHECK-NEXT: !19 = !MDCompositeType(tag: DW_TAG_structure_type, name: "Derived", file: !10, line: 3, scope: !14, baseType: !15, size: 128, align: 32, offset: 64, flags: DIFlagPublic, elements: !20, runtimeLang: DW_LANG_C_plus_plus_11, vtableHolder: !15, templateParams: !18, identifier: "MangledBase") +; CHECK-NEXT: !19 = !MDCompositeType(tag: DW_TAG_structure_type, name: "Derived", scope: !14, file: !10, line: 3, baseType: !15, size: 128, align: 32, offset: 64, flags: DIFlagPublic, elements: !20, runtimeLang: DW_LANG_C_plus_plus_11, vtableHolder: !15, templateParams: !18, identifier: "MangledBase") ; CHECK-NEXT: !20 = !{!21} ; CHECK-NEXT: !21 = !MDDerivedType(tag: DW_TAG_inheritance, scope: !19, baseType: !15) ; CHECK-NEXT: !22 = !MDDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !6, size: 32, align: 32, extraData: !15) ; CHECK-NEXT: !23 = !MDCompositeType(tag: DW_TAG_structure_type) ; CHECK-NEXT: !24 = !MDCompositeType(tag: DW_TAG_structure_type, runtimeLang: DW_LANG_Cobol85) !16 = !MDCompositeType(tag: DW_TAG_structure_type, name: "MyType", file: !12, line: 2, size: 32, align: 32, identifier: "MangledMyType") -!17 = !MDCompositeType(tag: DW_TAG_structure_type, name: "Base", file: !12, line: 3, scope: !16, size: 128, align: 32, offset: 64, flags: DIFlagPublic, elements: !18, runtimeLang: DW_LANG_C_plus_plus_11, vtableHolder: !17, templateParams: !20, identifier: "MangledBase") +!17 = !MDCompositeType(tag: DW_TAG_structure_type, name: "Base", scope: !16, file: !12, line: 3, size: 128, align: 32, offset: 64, flags: DIFlagPublic, elements: !18, runtimeLang: DW_LANG_C_plus_plus_11, vtableHolder: !17, templateParams: !20, identifier: "MangledBase") !18 = !{!19} -!19 = !MDDerivedType(tag: DW_TAG_member, name: "field", file: !12, line: 4, scope: !17, baseType: !7, size: 32, align: 32, offset: 32, flags: DIFlagPublic) +!19 = !MDDerivedType(tag: DW_TAG_member, name: "field", scope: !17, file: !12, line: 4, baseType: !7, size: 32, align: 32, offset: 32, flags: DIFlagPublic) !20 = !{!7} -!21 = !MDCompositeType(tag: DW_TAG_structure_type, name: "Derived", file: !12, line: 3, scope: !16, baseType: !17, size: 128, align: 32, offset: 64, flags: DIFlagPublic, elements: !22, runtimeLang: DW_LANG_C_plus_plus_11, vtableHolder: !17, templateParams: !20, identifier: "MangledBase") +!21 = !MDCompositeType(tag: DW_TAG_structure_type, name: "Derived", scope: !16, file: !12, line: 3, baseType: !17, size: 128, align: 32, offset: 64, flags: DIFlagPublic, elements: !22, runtimeLang: DW_LANG_C_plus_plus_11, vtableHolder: !17, templateParams: !20, identifier: "MangledBase") !22 = !{!23} !23 = !MDDerivedType(tag: DW_TAG_inheritance, scope: !21, baseType: !17) !24 = !MDDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !7, size: 32, align: 32, extraData: !17) diff --git a/test/Assembler/drop-debug-info.ll b/test/Assembler/drop-debug-info.ll index 5109b5e..698975d 100644 --- a/test/Assembler/drop-debug-info.ll +++ b/test/Assembler/drop-debug-info.ll @@ -12,15 +12,15 @@ entry: !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!9} -!0 = !{!"0x11\0012\00clang version 3.5 (trunk 195495) (llvm/trunk 195495:195504M)\000\00\000\00\000", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [/Users/manmanren/llvm_gmail/release/../llvm/tools/clang/test/CodeGen/debug-info-version.c] [DW_LANG_C99] -!1 = !{!"../llvm/tools/clang/test/CodeGen/debug-info-version.c", !"/Users/manmanren/llvm_gmail/release"} +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 (trunk 195495) (llvm/trunk 195495:195504M)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "../llvm/tools/clang/test/CodeGen/debug-info-version.c", directory: "/Users/manmanren/llvm_gmail/release") !2 = !{i32 0} !3 = !{!4} -!4 = !{!"0x2e\00main\00main\00\003\000\001\000\006\00256\000\003", !1, !5, !6, null, i32 ()* @main, null, null, !2} ; [ DW_TAG_subprogram ] [line 3] [def] [main] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/Users/manmanren/llvm_gmail/release/../llvm/tools/clang/test/CodeGen/debug-info-version.c] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !7, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "main", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !2) +!5 = !MDFile(filename: "../llvm/tools/clang/test/CodeGen/debug-info-version.c", directory: "/Users/manmanren/llvm_gmail/release") +!6 = !MDSubroutineType(types: !7) !7 = !{!8} -!8 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed] +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !9 = !{i32 2, !"Dwarf Version", i32 2} !12 = !MDLocation(line: 4, scope: !4) diff --git a/test/Assembler/fast-math-flags.ll b/test/Assembler/fast-math-flags.ll index 8e75bdf..f0d3ecc 100644 --- a/test/Assembler/fast-math-flags.ll +++ b/test/Assembler/fast-math-flags.ll @@ -9,12 +9,12 @@ define float @none(float %x, float %y) { entry: -; CHECK: %vec = load <3 x float>* @vec - %vec = load <3 x float>* @vec -; CHECK: %select = load i1* @select - %select = load i1* @select -; CHECK: %arr = load [3 x float]* @arr - %arr = load [3 x float]* @arr +; CHECK: %vec = load <3 x float>, <3 x float>* @vec + %vec = load <3 x float>, <3 x float>* @vec +; CHECK: %select = load i1, i1* @select + %select = load i1, i1* @select +; CHECK: %arr = load [3 x float], [3 x float]* @arr + %arr = load [3 x float], [3 x float]* @arr ; CHECK: %a = fadd float %x, %y %a = fadd float %x, %y @@ -43,12 +43,12 @@ entry: ; CHECK: no_nan define float @no_nan(float %x, float %y) { entry: -; CHECK: %vec = load <3 x float>* @vec - %vec = load <3 x float>* @vec -; CHECK: %select = load i1* @select - %select = load i1* @select -; CHECK: %arr = load [3 x float]* @arr - %arr = load [3 x float]* @arr +; CHECK: %vec = load <3 x float>, <3 x float>* @vec + %vec = load <3 x float>, <3 x float>* @vec +; CHECK: %select = load i1, i1* @select + %select = load i1, i1* @select +; CHECK: %arr = load [3 x float], [3 x float]* @arr + %arr = load [3 x float], [3 x float]* @arr ; CHECK: %a = fadd nnan float %x, %y %a = fadd nnan float %x, %y @@ -77,12 +77,12 @@ entry: ; CHECK: no_nan_inf define float @no_nan_inf(float %x, float %y) { entry: -; CHECK: %vec = load <3 x float>* @vec - %vec = load <3 x float>* @vec -; CHECK: %select = load i1* @select - %select = load i1* @select -; CHECK: %arr = load [3 x float]* @arr - %arr = load [3 x float]* @arr +; CHECK: %vec = load <3 x float>, <3 x float>* @vec + %vec = load <3 x float>, <3 x float>* @vec +; CHECK: %select = load i1, i1* @select + %select = load i1, i1* @select +; CHECK: %arr = load [3 x float], [3 x float]* @arr + %arr = load [3 x float], [3 x float]* @arr ; CHECK: %a = fadd nnan ninf float %x, %y %a = fadd ninf nnan float %x, %y @@ -111,12 +111,12 @@ entry: ; CHECK: mixed_flags define float @mixed_flags(float %x, float %y) { entry: -; CHECK: %vec = load <3 x float>* @vec - %vec = load <3 x float>* @vec -; CHECK: %select = load i1* @select - %select = load i1* @select -; CHECK: %arr = load [3 x float]* @arr - %arr = load [3 x float]* @arr +; CHECK: %vec = load <3 x float>, <3 x float>* @vec + %vec = load <3 x float>, <3 x float>* @vec +; CHECK: %select = load i1, i1* @select + %select = load i1, i1* @select +; CHECK: %arr = load [3 x float], [3 x float]* @arr + %arr = load [3 x float], [3 x float]* @arr ; CHECK: %a = fadd nnan ninf float %x, %y %a = fadd ninf nnan float %x, %y diff --git a/test/Assembler/flags.ll b/test/Assembler/flags.ll index e74311a..bcbfb18 100644 --- a/test/Assembler/flags.ll +++ b/test/Assembler/flags.ll @@ -148,14 +148,14 @@ define i64 @lshr_exact(i64 %x, i64 %y) { } define i64* @gep_nw(i64* %p, i64 %x) { -; CHECK: %z = getelementptr inbounds i64* %p, i64 %x - %z = getelementptr inbounds i64* %p, i64 %x +; CHECK: %z = getelementptr inbounds i64, i64* %p, i64 %x + %z = getelementptr inbounds i64, i64* %p, i64 %x ret i64* %z } define i64* @gep_plain(i64* %p, i64 %x) { -; CHECK: %z = getelementptr i64* %p, i64 %x - %z = getelementptr i64* %p, i64 %x +; CHECK: %z = getelementptr i64, i64* %p, i64 %x + %z = getelementptr i64, i64* %p, i64 %x ret i64* %z } @@ -195,8 +195,8 @@ define i64 @lshr_exact_ce() { } define i64* @gep_nw_ce() { -; CHECK: ret i64* getelementptr inbounds (i64* @addr, i64 171) - ret i64* getelementptr inbounds (i64* @addr, i64 171) +; CHECK: ret i64* getelementptr inbounds (i64, i64* @addr, i64 171) + ret i64* getelementptr inbounds (i64, i64* @addr, i64 171) } define i64 @add_plain_ce() { @@ -220,8 +220,8 @@ define i64 @sdiv_plain_ce() { } define i64* @gep_plain_ce() { -; CHECK: ret i64* getelementptr (i64* @addr, i64 171) - ret i64* getelementptr (i64* @addr, i64 171) +; CHECK: ret i64* getelementptr (i64, i64* @addr, i64 171) + ret i64* getelementptr (i64, i64* @addr, i64 171) } define i64 @add_both_reversed_ce() { diff --git a/test/Assembler/functionlocal-metadata.ll b/test/Assembler/functionlocal-metadata.ll deleted file mode 100644 index 517138d..0000000 --- a/test/Assembler/functionlocal-metadata.ll +++ /dev/null @@ -1,55 +0,0 @@ -; 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, 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, 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 !{!"0x102"}) -; CHECK: call void @llvm.dbg.declare(metadata i32 %two, metadata i32 %0, metadata {{.*}}) - call void @llvm.dbg.declare(metadata i32* %1, metadata i32 %b, metadata !{!"0x102"}) -; CHECK: call void @llvm.dbg.declare(metadata i32* %1, metadata i32 %b, metadata {{.*}}) - call void @llvm.dbg.declare(metadata i32 %a, metadata i32 %a, metadata !{!"0x102"}) -; CHECK: call void @llvm.dbg.declare(metadata i32 %a, metadata i32 %a, metadata {{.*}}) - call void @llvm.dbg.declare(metadata i32 %b, metadata i32 %two, metadata !{!"0x102"}) -; CHECK: call void @llvm.dbg.declare(metadata i32 %b, metadata i32 %two, metadata {{.*}}) - - call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !1, 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 !{!"0x102"}) -; CHECK: call void @llvm.dbg.value(metadata i32 %0, i64 25, metadata ![[ID0:[0-9]+]], metadata {{.*}}) - call void @llvm.dbg.value(metadata i32* %1, i64 16, metadata !3, 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 !{!"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]+]] -} - -!llvm.module.flags = !{!4} - -!0 = !MDLocation(line: 662302, column: 26, scope: !1) -!1 = !{i32 4, !"foo"} -!2 = !{!"bar"} -!3 = !{!"foo"} -!4 = !{i32 1, !"Debug Info Version", i32 2} - -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 } - -; CHECK: !foo = !{![[FOO]]} -; CHECK: !bar = !{![[BAR]]} -; CHECK: ![[ID0]] = !MDLocation(line: 662302, column: 26, scope: ![[ID1]]) -; CHECK: ![[ID1]] = !{i32 4, !"foo"} -; CHECK: ![[ID2]] = !{!"bar"} -; CHECK: ![[ID3]] = !{!"foo"} diff --git a/test/Assembler/getelementptr.ll b/test/Assembler/getelementptr.ll index bd583af..ee88346 100644 --- a/test/Assembler/getelementptr.ll +++ b/test/Assembler/getelementptr.ll @@ -3,42 +3,42 @@ ; Verify that over-indexed getelementptrs are folded. @A = external global [2 x [3 x [5 x [7 x i32]]]] -@B = global i32* getelementptr ([2 x [3 x [5 x [7 x i32]]]]* @A, i64 0, i64 0, i64 2, i64 1, i64 7523) -; CHECK: @B = global i32* getelementptr ([2 x [3 x [5 x [7 x i32]]]]* @A, i64 36, i64 0, i64 1, i64 0, i64 5) -@C = global i32* getelementptr ([2 x [3 x [5 x [7 x i32]]]]* @A, i64 3, i64 2, i64 0, i64 0, i64 7523) -; CHECK: @C = global i32* getelementptr ([2 x [3 x [5 x [7 x i32]]]]* @A, i64 39, i64 1, i64 1, i64 4, i64 5) +@B = global i32* getelementptr ([2 x [3 x [5 x [7 x i32]]]], [2 x [3 x [5 x [7 x i32]]]]* @A, i64 0, i64 0, i64 2, i64 1, i64 7523) +; CHECK: @B = global i32* getelementptr ([2 x [3 x [5 x [7 x i32]]]], [2 x [3 x [5 x [7 x i32]]]]* @A, i64 36, i64 0, i64 1, i64 0, i64 5) +@C = global i32* getelementptr ([2 x [3 x [5 x [7 x i32]]]], [2 x [3 x [5 x [7 x i32]]]]* @A, i64 3, i64 2, i64 0, i64 0, i64 7523) +; CHECK: @C = global i32* getelementptr ([2 x [3 x [5 x [7 x i32]]]], [2 x [3 x [5 x [7 x i32]]]]* @A, i64 39, i64 1, i64 1, i64 4, i64 5) ; Verify that constant expression GEPs work with i84 indices. @D = external global [1 x i32] -@E = global i32* getelementptr inbounds ([1 x i32]* @D, i84 0, i64 1) -; CHECK: @E = global i32* getelementptr inbounds ([1 x i32]* @D, i84 1, i64 0) +@E = global i32* getelementptr inbounds ([1 x i32], [1 x i32]* @D, i84 0, i64 1) +; CHECK: @E = global i32* getelementptr inbounds ([1 x i32], [1 x i32]* @D, i84 1, i64 0) ; Verify that i16 indices work. @x = external global {i32, i32} -@y = global i32* getelementptr ({ i32, i32 }* @x, i16 42, i32 0) -; CHECK: @y = global i32* getelementptr ({ i32, i32 }* @x, i16 42, i32 0) +@y = global i32* getelementptr ({ i32, i32 }, { i32, i32 }* @x, i16 42, i32 0) +; CHECK: @y = global i32* getelementptr ({ i32, i32 }, { i32, i32 }* @x, i16 42, i32 0) ; See if i92 indices work too. define i32 *@test({i32, i32}* %t, i92 %n) { ; CHECK: @test -; CHECK: %B = getelementptr { i32, i32 }* %t, i92 %n, i32 0 - %B = getelementptr {i32, i32}* %t, i92 %n, i32 0 +; CHECK: %B = getelementptr { i32, i32 }, { i32, i32 }* %t, i92 %n, i32 0 + %B = getelementptr {i32, i32}, {i32, i32}* %t, i92 %n, i32 0 ret i32* %B } ; Verify that constant expression vector GEPs work. -@z = global <2 x i32*> getelementptr (<2 x [3 x {i32, i32}]*> zeroinitializer, <2 x i32> <i32 1, i32 2>, <2 x i32> <i32 2, i32 3>, <2 x i32> <i32 1, i32 1>) +@z = global <2 x i32*> getelementptr ([3 x {i32, i32}], <2 x [3 x {i32, i32}]*> zeroinitializer, <2 x i32> <i32 1, i32 2>, <2 x i32> <i32 2, i32 3>, <2 x i32> <i32 1, i32 1>) ; Verify that struct GEP works with a vector of pointers. define <2 x i32*> @test7(<2 x {i32, i32}*> %a) { - %w = getelementptr <2 x {i32, i32}*> %a, <2 x i32> <i32 5, i32 9>, <2 x i32> zeroinitializer + %w = getelementptr {i32, i32}, <2 x {i32, i32}*> %a, <2 x i32> <i32 5, i32 9>, <2 x i32> zeroinitializer ret <2 x i32*> %w } ; Verify that array GEP works with a vector of pointers. define <2 x i8*> @test8(<2 x [2 x i8]*> %a) { - %w = getelementptr <2 x [2 x i8]*> %a, <2 x i32> <i32 0, i32 0>, <2 x i8> <i8 0, i8 1> + %w = getelementptr [2 x i8], <2 x [2 x i8]*> %a, <2 x i32> <i32 0, i32 0>, <2 x i8> <i8 0, i8 1> ret <2 x i8*> %w } diff --git a/test/Assembler/getelementptr_invalid_ptr.ll b/test/Assembler/getelementptr_invalid_ptr.ll new file mode 100644 index 0000000..8922927 --- /dev/null +++ b/test/Assembler/getelementptr_invalid_ptr.ll @@ -0,0 +1,10 @@ +; RUN: not llvm-as < %s 2>&1 | FileCheck %s +; Test the case of an invalid pointer type on a GEP + +; CHECK: base of getelementptr must be a pointer + +define i32* @foo(i32 %a) { + %gep = getelementptr i32, i32 %a, i32 1 + return i32* %gep +} + diff --git a/test/Assembler/getelementptr_struct.ll b/test/Assembler/getelementptr_struct.ll index 0293672..9ab5546 100644 --- a/test/Assembler/getelementptr_struct.ll +++ b/test/Assembler/getelementptr_struct.ll @@ -9,7 +9,7 @@ define i32* @foo(%ST* %s) { entry: - %reg = getelementptr %ST* %s, i32 1, i64 2, i32 1, i32 5, i32 13 + %reg = getelementptr %ST, %ST* %s, i32 1, i64 2, i32 1, i32 5, i32 13 ret i32* %reg } diff --git a/test/Assembler/getelementptr_vec_idx1.ll b/test/Assembler/getelementptr_vec_idx1.ll index d2479f4..084a31e 100644 --- a/test/Assembler/getelementptr_vec_idx1.ll +++ b/test/Assembler/getelementptr_vec_idx1.ll @@ -5,6 +5,6 @@ ; CHECK: getelementptr index type missmatch define i32 @test(i32* %a) { - %w = getelementptr i32* %a, <2 x i32> <i32 5, i32 9> + %w = getelementptr i32, i32* %a, <2 x i32> <i32 5, i32 9> ret i32 %w } diff --git a/test/Assembler/getelementptr_vec_idx2.ll b/test/Assembler/getelementptr_vec_idx2.ll index 8b71ce3..638fcb8 100644 --- a/test/Assembler/getelementptr_vec_idx2.ll +++ b/test/Assembler/getelementptr_vec_idx2.ll @@ -5,6 +5,6 @@ ; CHECK: getelementptr index type missmatch define <2 x i32> @test(<2 x i32*> %a) { - %w = getelementptr <2 x i32*> %a, i32 2 + %w = getelementptr i32, <2 x i32*> %a, i32 2 ret <2 x i32> %w } diff --git a/test/Assembler/getelementptr_vec_idx3.ll b/test/Assembler/getelementptr_vec_idx3.ll index 1f6c29b..ac94459 100644 --- a/test/Assembler/getelementptr_vec_idx3.ll +++ b/test/Assembler/getelementptr_vec_idx3.ll @@ -5,6 +5,6 @@ ; CHECK: getelementptr index type missmatch define <4 x i32> @test(<4 x i32>* %a) { - %w = getelementptr <4 x i32>* %a, <2 x i32> <i32 5, i32 9> + %w = getelementptr <4 x i32>, <4 x i32>* %a, <2 x i32> <i32 5, i32 9> ret i32 %w } diff --git a/test/Assembler/getelementptr_vec_idx4.ll b/test/Assembler/getelementptr_vec_idx4.ll index 08fe434..f270a0c 100644 --- a/test/Assembler/getelementptr_vec_idx4.ll +++ b/test/Assembler/getelementptr_vec_idx4.ll @@ -2,4 +2,4 @@ ; CHECK: getelementptr vector index has a wrong number of elements -global <2 x i32*> getelementptr (<4 x [3 x {i32, i32}]*> zeroinitializer, <2 x i32> <i32 1, i32 2>, <2 x i32> <i32 2, i32 3>, <2 x i32> <i32 1, i32 1>) +global <2 x i32*> getelementptr ([3 x {i32, i32}], <4 x [3 x {i32, i32}]*> zeroinitializer, <2 x i32> <i32 1, i32 2>, <2 x i32> <i32 2, i32 3>, <2 x i32> <i32 1, i32 1>) diff --git a/test/Assembler/getelementptr_vec_struct.ll b/test/Assembler/getelementptr_vec_struct.ll index ec66836..493da66 100644 --- a/test/Assembler/getelementptr_vec_struct.ll +++ b/test/Assembler/getelementptr_vec_struct.ll @@ -5,6 +5,6 @@ ; CHECK: invalid getelementptr indices define <2 x i32*> @test7(<2 x {i32, i32}*> %a) { - %w = getelementptr <2 x {i32, i32}*> %a, <2 x i32> <i32 5, i32 9>, <2 x i32> <i32 0, i32 1> + %w = getelementptr {i32, i32}, <2 x {i32, i32}*> %a, <2 x i32> <i32 5, i32 9>, <2 x i32> <i32 0, i32 1> ret <2 x i32*> %w } diff --git a/test/Assembler/half-constprop.ll b/test/Assembler/half-constprop.ll index c5ae3bf..7ca876b 100644 --- a/test/Assembler/half-constprop.ll +++ b/test/Assembler/half-constprop.ll @@ -9,8 +9,8 @@ entry: %.compoundliteral = alloca float, align 4 store half 0xH4200, half* %a, align 2 store half 0xH4B9A, half* %b, align 2 - %tmp = load half* %a, align 2 - %tmp1 = load half* %b, align 2 + %tmp = load half, half* %a, align 2 + %tmp1 = load half, half* %b, align 2 %add = fadd half %tmp, %tmp1 ; CHECK: 0xH4C8D ret half %add diff --git a/test/Assembler/half-conv.ll b/test/Assembler/half-conv.ll index e6f73cf..6575501 100644 --- a/test/Assembler/half-conv.ll +++ b/test/Assembler/half-conv.ll @@ -7,7 +7,7 @@ entry: %a = alloca half, align 2 %.compoundliteral = alloca float, align 4 store half 0xH4C8D, half* %a, align 2 - %tmp = load half* %a, align 2 + %tmp = load half, half* %a, align 2 %conv = fpext half %tmp to float ; CHECK: 0x4032340000000000 ret float %conv diff --git a/test/Assembler/insertextractvalue.ll b/test/Assembler/insertextractvalue.ll index 692843e..71dbba3 100644 --- a/test/Assembler/insertextractvalue.ll +++ b/test/Assembler/insertextractvalue.ll @@ -8,7 +8,7 @@ ; CHECK-NEXT: store ; CHECK-NEXT: ret define float @foo({{i32},{float, double}}* %p) nounwind { - %t = load {{i32},{float, double}}* %p + %t = load {{i32},{float, double}}, {{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 diff --git a/test/Assembler/invalid-datalayout19.ll b/test/Assembler/invalid-datalayout19.ll new file mode 100644 index 0000000..fc0fc46 --- /dev/null +++ b/test/Assembler/invalid-datalayout19.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s 2>&1 | FileCheck %s + +target datalayout = "p:0:32:32" + +; CHECK: Invalid pointer size of 0 bytes + diff --git a/test/Assembler/invalid-datalayout20.ll b/test/Assembler/invalid-datalayout20.ll new file mode 100644 index 0000000..a9ac1d7 --- /dev/null +++ b/test/Assembler/invalid-datalayout20.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s 2>&1 | FileCheck %s + +target datalayout = "p:64:24:64" + +; CHECK: Pointer ABI alignment must be a power of 2 + diff --git a/test/Assembler/invalid-datalayout21.ll b/test/Assembler/invalid-datalayout21.ll new file mode 100644 index 0000000..a39d1d7 --- /dev/null +++ b/test/Assembler/invalid-datalayout21.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s 2>&1 | FileCheck %s + +target datalayout = "p:64:64:24" + +; CHECK: Pointer preferred alignment must be a power of 2 + diff --git a/test/Assembler/invalid-datalayout22.ll b/test/Assembler/invalid-datalayout22.ll new file mode 100644 index 0000000..14e4c28 --- /dev/null +++ b/test/Assembler/invalid-datalayout22.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s 2>&1 | FileCheck %s + +target datalayout = "v128:0:128" + +; CHECK: ABI alignment specification must be >0 for non-aggregate types + diff --git a/test/Assembler/invalid-datalayout23.ll b/test/Assembler/invalid-datalayout23.ll new file mode 100644 index 0000000..4303263 --- /dev/null +++ b/test/Assembler/invalid-datalayout23.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s 2>&1 | FileCheck %s + +target datalayout = "i32:24:32" + +; CHECK: Invalid ABI alignment, must be a power of 2 + diff --git a/test/Assembler/invalid-datalayout24.ll b/test/Assembler/invalid-datalayout24.ll new file mode 100644 index 0000000..616ec64 --- /dev/null +++ b/test/Assembler/invalid-datalayout24.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s 2>&1 | FileCheck %s + +target datalayout = "i32:32:24" + +; CHECK: Invalid preferred alignment, must be a power of 2 + diff --git a/test/Assembler/invalid-generic-debug-node-tag-overflow.ll b/test/Assembler/invalid-generic-debug-node-tag-overflow.ll index 1722caa..b518946 100644 --- a/test/Assembler/invalid-generic-debug-node-tag-overflow.ll +++ b/test/Assembler/invalid-generic-debug-node-tag-overflow.ll @@ -1,6 +1,6 @@ ; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s -; CHECK-NOT: error +; CHECK-NOT: error: !0 = !GenericDebugNode(tag: 65535) ; CHECK: <stdin>:[[@LINE+1]]:29: error: value for 'tag' too large, limit is 65535 diff --git a/test/Assembler/invalid-gep-mismatched-explicit-type.ll b/test/Assembler/invalid-gep-mismatched-explicit-type.ll new file mode 100644 index 0000000..1fc88dd --- /dev/null +++ b/test/Assembler/invalid-gep-mismatched-explicit-type.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s 2>&1 | FileCheck %s +; CHECK: <stdin>:4:22: error: explicit pointee type doesn't match operand's pointee type +define void @test(i32* %t) { + %x = getelementptr i16, i32* %t, i32 0 + ret void +} diff --git a/test/Assembler/invalid-gep-missing-explicit-type.ll b/test/Assembler/invalid-gep-missing-explicit-type.ll new file mode 100644 index 0000000..6f7281a --- /dev/null +++ b/test/Assembler/invalid-gep-missing-explicit-type.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-as < %s 2>&1 | FileCheck %s +; CHECK: <stdin>:4:27: error: expected comma after getelementptr's type +define void @test(i32* %t) { + %x = getelementptr i32* %t, i32 0 + ret void +} + diff --git a/test/Assembler/invalid-label.ll b/test/Assembler/invalid-label.ll new file mode 100644 index 0000000..33dc636 --- /dev/null +++ b/test/Assembler/invalid-label.ll @@ -0,0 +1,11 @@ +; RUN: not llvm-as < %s >/dev/null 2> %t +; RUN: FileCheck %s < %t +; Test the case where an invalid label name is used + +; CHECK: unable to create block named 'bb' + +define void @test(label %bb) { +bb: + ret void +} + diff --git a/test/Assembler/invalid-landingpad.ll b/test/Assembler/invalid-landingpad.ll new file mode 100644 index 0000000..c8eab4a --- /dev/null +++ b/test/Assembler/invalid-landingpad.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-as < %s 2>&1 | FileCheck %s + +; CHECK: clause argument must be a constant + +define void @test(i32 %in) { + landingpad {} personality void()* null filter i32 %in +} diff --git a/test/Assembler/invalid-load-mismatched-explicit-type.ll b/test/Assembler/invalid-load-mismatched-explicit-type.ll new file mode 100644 index 0000000..b8422ed --- /dev/null +++ b/test/Assembler/invalid-load-mismatched-explicit-type.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s 2>&1 | FileCheck %s +; CHECK: <stdin>:4:13: error: explicit pointee type doesn't match operand's pointee type +define void @test(i32* %t) { + %x = load i16, i32* %t + ret void +} diff --git a/test/Assembler/invalid-load-missing-explicit-type.ll b/test/Assembler/invalid-load-missing-explicit-type.ll new file mode 100644 index 0000000..455498e --- /dev/null +++ b/test/Assembler/invalid-load-missing-explicit-type.ll @@ -0,0 +1,6 @@ +; RUN: not llvm-as < %s 2>&1 | FileCheck %s +; CHECK: <stdin>:4:18: error: expected comma after load's type +define void @test(i32* %t) { + %x = load i32* %t + ret void +} diff --git a/test/Assembler/invalid-mdbasictype-missing-tag.ll b/test/Assembler/invalid-mdbasictype-missing-tag.ll deleted file mode 100644 index 4b3823d..0000000 --- a/test/Assembler/invalid-mdbasictype-missing-tag.ll +++ /dev/null @@ -1,4 +0,0 @@ -; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s - -; CHECK: [[@LINE+1]]:31: error: missing required field 'tag' -!0 = !MDBasicType(name: "name") diff --git a/test/Assembler/invalid-mdcompileunit-language-overflow.ll b/test/Assembler/invalid-mdcompileunit-language-overflow.ll index 14dab17..1849867 100644 --- a/test/Assembler/invalid-mdcompileunit-language-overflow.ll +++ b/test/Assembler/invalid-mdcompileunit-language-overflow.ll @@ -1,6 +1,6 @@ ; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s -; CHECK-NOT: error +; CHECK-NOT: error: !0 = !MDCompileUnit(language: 65535, file: !MDFile(filename: "a", directory: "b")) diff --git a/test/Assembler/invalid-mdexpression-large.ll b/test/Assembler/invalid-mdexpression-large.ll index 43b8ce0..fb30413 100644 --- a/test/Assembler/invalid-mdexpression-large.ll +++ b/test/Assembler/invalid-mdexpression-large.ll @@ -1,6 +1,6 @@ ; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s -; CHECK-NOT: error +; CHECK-NOT: error: !0 = !MDExpression(18446744073709551615) ; CHECK: <stdin>:[[@LINE+1]]:20: error: element too large, limit is 18446744073709551615 diff --git a/test/Assembler/invalid-mdglobalvariable-missing-name.ll b/test/Assembler/invalid-mdglobalvariable-missing-name.ll deleted file mode 100644 index bc0f724..0000000 --- a/test/Assembler/invalid-mdglobalvariable-missing-name.ll +++ /dev/null @@ -1,4 +0,0 @@ -; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s - -; CHECK: <stdin>:[[@LINE+1]]:42: error: missing required field 'name' -!0 = !MDGlobalVariable(linkageName: "foo") diff --git a/test/Assembler/invalid-mdlocation-overflow-column.ll b/test/Assembler/invalid-mdlocation-overflow-column.ll index 92ea661..1c06697 100644 --- a/test/Assembler/invalid-mdlocation-overflow-column.ll +++ b/test/Assembler/invalid-mdlocation-overflow-column.ll @@ -2,7 +2,7 @@ !0 = !{} -; CHECK-NOT: error +; CHECK-NOT: error: !1 = !MDLocation(column: 65535, scope: !0) ; CHECK: <stdin>:[[@LINE+1]]:26: error: value for 'column' too large, limit is 65535 diff --git a/test/Assembler/invalid-mdlocation-overflow-line.ll b/test/Assembler/invalid-mdlocation-overflow-line.ll index 535b4c9..571a555 100644 --- a/test/Assembler/invalid-mdlocation-overflow-line.ll +++ b/test/Assembler/invalid-mdlocation-overflow-line.ll @@ -2,7 +2,7 @@ !0 = !{} -; CHECK-NOT: error +; CHECK-NOT: error: !1 = !MDLocation(line: 4294967295, scope: !0) ; CHECK: <stdin>:[[@LINE+1]]:24: error: value for 'line' too large, limit is 4294967295 diff --git a/test/Assembler/invalid-mdobjcproperty-missing-name.ll b/test/Assembler/invalid-mdobjcproperty-missing-name.ll deleted file mode 100644 index b55cfa8..0000000 --- a/test/Assembler/invalid-mdobjcproperty-missing-name.ll +++ /dev/null @@ -1,4 +0,0 @@ -; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s - -; CHECK: [[@LINE+1]]:38: error: missing required field 'name' -!0 = !MDObjCProperty(setter: "setFoo") diff --git a/test/Assembler/invalid-mdsubprogram-missing-name.ll b/test/Assembler/invalid-mdsubprogram-missing-name.ll deleted file mode 100644 index 54ded22..0000000 --- a/test/Assembler/invalid-mdsubprogram-missing-name.ll +++ /dev/null @@ -1,4 +0,0 @@ -; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s - -; CHECK: <stdin>:[[@LINE+1]]:38: error: missing required field 'name' -!0 = !MDSubprogram(linkageName: "foo") diff --git a/test/Assembler/invalid-mdsubrange-count-large.ll b/test/Assembler/invalid-mdsubrange-count-large.ll index 0d150aa..733c4af 100644 --- a/test/Assembler/invalid-mdsubrange-count-large.ll +++ b/test/Assembler/invalid-mdsubrange-count-large.ll @@ -1,6 +1,6 @@ ; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s -; CHECK-NOT: error +; CHECK-NOT: error: !0 = !MDSubrange(count: 9223372036854775807) ; CHECK: <stdin>:[[@LINE+1]]:25: error: value for 'count' too large, limit is 9223372036854775807 diff --git a/test/Assembler/invalid-mdsubrange-count-negative.ll b/test/Assembler/invalid-mdsubrange-count-negative.ll index 92c0b4e..9bfe784 100644 --- a/test/Assembler/invalid-mdsubrange-count-negative.ll +++ b/test/Assembler/invalid-mdsubrange-count-negative.ll @@ -1,6 +1,6 @@ ; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s -; CHECK-NOT: error +; CHECK-NOT: error: !0 = !MDSubrange(count: -1) ; CHECK: <stdin>:[[@LINE+1]]:25: error: value for 'count' too small, limit is -1 diff --git a/test/Assembler/invalid-mdtemplatevalueparameter-missing-tag.ll b/test/Assembler/invalid-mdtemplatevalueparameter-missing-tag.ll deleted file mode 100644 index fea218c..0000000 --- a/test/Assembler/invalid-mdtemplatevalueparameter-missing-tag.ll +++ /dev/null @@ -1,4 +0,0 @@ -; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s - -; CHECK: [[@LINE+1]]:55: error: missing required field 'tag' -!0 = !MDTemplateValueParameter(type: !{}, value: i32 7) diff --git a/test/Assembler/invalid-mdtemplatevalueparameter-missing-type.ll b/test/Assembler/invalid-mdtemplatevalueparameter-missing-type.ll deleted file mode 100644 index 8ea3acc..0000000 --- a/test/Assembler/invalid-mdtemplatevalueparameter-missing-type.ll +++ /dev/null @@ -1,5 +0,0 @@ -; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s - -; CHECK: [[@LINE+2]]:44: error: missing required field 'type' -!0 = !MDTemplateValueParameter(tag: DW_TAG_template_value_parameter, - value: i32 7) diff --git a/test/Assembler/mdfile-escaped-chars.ll b/test/Assembler/mdfile-escaped-chars.ll new file mode 100644 index 0000000..5dfd12c --- /dev/null +++ b/test/Assembler/mdfile-escaped-chars.ll @@ -0,0 +1,9 @@ +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s + +; Spot-check that metadata string fields are correctly escaped. + +!named = !{!0} + +; CHECK: !0 = !MDFile(filename: "\00\01\02\80\81\82\FD\FE\FF", directory: "/dir") +!0 = !MDFile(filename: "\00\01\02\80\81\82\FD\FE\FF", directory: "/dir") diff --git a/test/Assembler/mdglobalvariable.ll b/test/Assembler/mdglobalvariable.ll index ef04f3e..09d20bf 100644 --- a/test/Assembler/mdglobalvariable.ll +++ b/test/Assembler/mdglobalvariable.ll @@ -12,11 +12,11 @@ !3 = distinct !{} !4 = distinct !{} -; CHECK: !5 = !MDGlobalVariable(scope: !0, name: "foo", linkageName: "foo", file: !2, line: 7, type: !3, isLocal: true, isDefinition: false, variable: i32* @foo, declaration: !4) -!5 = !MDGlobalVariable(scope: !0, name: "foo", linkageName: "foo", +; CHECK: !5 = !MDGlobalVariable(name: "foo", linkageName: "foo", scope: !0, file: !2, line: 7, type: !3, isLocal: true, isDefinition: false, variable: i32* @foo, declaration: !4) +!5 = !MDGlobalVariable(name: "foo", linkageName: "foo", scope: !0, file: !2, line: 7, type: !3, isLocal: true, isDefinition: false, variable: i32* @foo, declaration: !4) -; CHECK: !6 = !MDGlobalVariable(scope: null, name: "bar", isLocal: false, isDefinition: true) -!6 = !MDGlobalVariable(name: "bar") +; CHECK: !6 = !MDGlobalVariable(scope: null, isLocal: false, isDefinition: true) +!6 = !MDGlobalVariable() diff --git a/test/Assembler/mdimportedentity.ll b/test/Assembler/mdimportedentity.ll index a1ac48d..0584edb 100644 --- a/test/Assembler/mdimportedentity.ll +++ b/test/Assembler/mdimportedentity.ll @@ -9,12 +9,12 @@ !0 = distinct !{} !1 = distinct !{} -; CHECK-NEXT: !2 = !MDImportedEntity(tag: DW_TAG_imported_module, scope: !0, entity: !1, line: 7, name: "foo") -!2 = !MDImportedEntity(tag: DW_TAG_imported_module, scope: !0, entity: !1, - line: 7, name: "foo") +; CHECK-NEXT: !2 = !MDImportedEntity(tag: DW_TAG_imported_module, name: "foo", scope: !0, entity: !1, line: 7) +!2 = !MDImportedEntity(tag: DW_TAG_imported_module, name: "foo", scope: !0, + entity: !1, line: 7) -; CHECK-NEXT: !3 = !MDImportedEntity(tag: DW_TAG_imported_module, scope: !0, name: "") +; CHECK-NEXT: !3 = !MDImportedEntity(tag: DW_TAG_imported_module, scope: !0) !3 = !MDImportedEntity(tag: DW_TAG_imported_module, scope: !0) -!4 = !MDImportedEntity(tag: DW_TAG_imported_module, scope: !0, entity: null, - line: 0, name: "") +!4 = !MDImportedEntity(tag: DW_TAG_imported_module, name: "", scope: !0, entity: null, + line: 0) diff --git a/test/Assembler/mdlocalvariable.ll b/test/Assembler/mdlocalvariable.ll index 7a4185f..3a36c7d 100644 --- a/test/Assembler/mdlocalvariable.ll +++ b/test/Assembler/mdlocalvariable.ll @@ -12,15 +12,15 @@ !3 = distinct !{} !4 = distinct !{} -; CHECK: !5 = !MDLocalVariable(tag: DW_TAG_arg_variable, scope: !0, name: "foo", file: !2, line: 7, type: !3, arg: 3, flags: DIFlagArtificial, inlinedAt: !4) -; CHECK: !6 = !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !0, name: "foo", file: !2, line: 7, type: !3, flags: DIFlagArtificial, inlinedAt: !4) -!5 = !MDLocalVariable(tag: DW_TAG_arg_variable, scope: !0, name: "foo", - file: !2, line: 7, type: !3, arg: 3, +; CHECK: !5 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "foo", arg: 3, scope: !0, file: !2, line: 7, type: !3, flags: DIFlagArtificial, inlinedAt: !4) +; CHECK: !6 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "foo", scope: !0, file: !2, line: 7, type: !3, flags: DIFlagArtificial, inlinedAt: !4) +!5 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "foo", arg: 3, + scope: !0, file: !2, line: 7, type: !3, flags: DIFlagArtificial, inlinedAt: !4) -!6 = !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !0, name: "foo", +!6 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "foo", scope: !0, file: !2, line: 7, type: !3, flags: DIFlagArtificial, inlinedAt: !4) -; CHECK: !7 = !MDLocalVariable(tag: DW_TAG_arg_variable, scope: null, name: "", arg: 0) -; CHECK: !8 = !MDLocalVariable(tag: DW_TAG_auto_variable, scope: null, name: "") +; CHECK: !7 = !MDLocalVariable(tag: DW_TAG_arg_variable, arg: 0, scope: null) +; CHECK: !8 = !MDLocalVariable(tag: DW_TAG_auto_variable, scope: null) !7 = !MDLocalVariable(tag: DW_TAG_arg_variable) !8 = !MDLocalVariable(tag: DW_TAG_auto_variable) diff --git a/test/Assembler/mdlocation.ll b/test/Assembler/mdlocation.ll index e095d90..47e6e98 100644 --- a/test/Assembler/mdlocation.ll +++ b/test/Assembler/mdlocation.ll @@ -4,8 +4,8 @@ ; CHECK: !named = !{!0, !1, !1, !2, !2, !3, !3, !4} !named = !{!0, !1, !2, !3, !4, !5, !6, !7} -; CHECK: !0 = !{} -!0 = !{} +; CHECK: !0 = !MDSubprogram( +!0 = !MDSubprogram() ; CHECK-NEXT: !1 = !MDLocation(line: 3, column: 7, scope: !0) !1 = !MDLocation(line: 3, column: 7, scope: !0) diff --git a/test/Assembler/mdnamespace.ll b/test/Assembler/mdnamespace.ll index d7f6849..90cb15f 100644 --- a/test/Assembler/mdnamespace.ll +++ b/test/Assembler/mdnamespace.ll @@ -8,9 +8,9 @@ !1 = distinct !{} !2 = !MDFile(filename: "path/to/file", directory: "/path/to/dir") -; CHECK: !3 = !MDNamespace(scope: !0, file: !2, name: "Namespace", line: 7) -!3 = !MDNamespace(scope: !0, file: !2, name: "Namespace", line: 7) +; CHECK: !3 = !MDNamespace(name: "Namespace", scope: !0, file: !2, line: 7) +!3 = !MDNamespace(name: "Namespace", scope: !0, file: !2, line: 7) ; CHECK: !4 = !MDNamespace(scope: !0) -!4 = !MDNamespace(scope: !0, file: null, name: "", line: 0) +!4 = !MDNamespace(name: "", scope: !0, file: null, line: 0) !5 = !MDNamespace(scope: !0) diff --git a/test/Assembler/mdobjcproperty.ll b/test/Assembler/mdobjcproperty.ll index 8afe943..cb2f4d3 100644 --- a/test/Assembler/mdobjcproperty.ll +++ b/test/Assembler/mdobjcproperty.ll @@ -14,7 +14,7 @@ !3 = !MDObjCProperty(name: "foo", file: !1, line: 7, setter: "setFoo", getter: "getFoo", attributes: 7, type: !2) -; CHECK-NEXT: !4 = !MDObjCProperty(name: "foo") -!4 = !MDObjCProperty(name: "foo", file: null, line: 0, setter: "", getter: "", +; CHECK-NEXT: !4 = !MDObjCProperty() +!4 = !MDObjCProperty(name: "", file: null, line: 0, setter: "", getter: "", attributes: 0, type: null) -!5 = !MDObjCProperty(name: "foo") +!5 = !MDObjCProperty() diff --git a/test/Assembler/mdsubprogram.ll b/test/Assembler/mdsubprogram.ll index aecfefc..7447166 100644 --- a/test/Assembler/mdsubprogram.ll +++ b/test/Assembler/mdsubprogram.ll @@ -15,14 +15,14 @@ declare void @_Z3foov() !6 = distinct !{} !7 = distinct !{} -; CHECK: !8 = !MDSubprogram(scope: !0, name: "foo", linkageName: "_Zfoov", file: !2, line: 7, type: !3, isLocal: true, isDefinition: false, scopeLine: 8, containingType: !4, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 10, flags: DIFlagPrototyped, isOptimized: true, function: void ()* @_Z3foov, templateParams: !5, declaration: !6, variables: !7) -!8 = !MDSubprogram(scope: !0, name: "foo", linkageName: "_Zfoov", +; CHECK: !8 = !MDSubprogram(name: "foo", linkageName: "_Zfoov", scope: !0, file: !2, line: 7, type: !3, isLocal: true, isDefinition: false, scopeLine: 8, containingType: !4, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 10, flags: DIFlagPrototyped, isOptimized: true, function: void ()* @_Z3foov, templateParams: !5, declaration: !6, variables: !7) +!8 = !MDSubprogram(name: "foo", linkageName: "_Zfoov", scope: !0, file: !2, line: 7, type: !3, isLocal: true, isDefinition: false, scopeLine: 8, containingType: !4, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 10, flags: DIFlagPrototyped, isOptimized: true, function: void ()* @_Z3foov, templateParams: !5, declaration: !6, variables: !7) -; CHECK: !9 = !MDSubprogram(scope: null, name: "bar", isLocal: false, isDefinition: true, isOptimized: false) -!9 = !MDSubprogram(name: "bar") +; CHECK: !9 = !MDSubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false) +!9 = !MDSubprogram() diff --git a/test/Assembler/mdtemplateparameter.ll b/test/Assembler/mdtemplateparameter.ll index f005c08..22ee5c8 100644 --- a/test/Assembler/mdtemplateparameter.ll +++ b/test/Assembler/mdtemplateparameter.ll @@ -1,24 +1,24 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s ; RUN: verify-uselistorder %s -; CHECK: !named = !{!0, !1, !2, !3, !3, !4, !5, !5} -!named = !{!0, !1, !2, !3, !4, !5, !6, !7} +; CHECK: !named = !{!0, !1, !2, !3, !3, !4, !5, !5, !6} +!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8} !0 = distinct !{} !1 = distinct !{} ; CHECK: !1 = distinct !{} ; CHECK-NEXT: !2 = !MDTemplateTypeParameter(name: "Ty", type: !1) -; CHECK-NEXT: !3 = !MDTemplateTypeParameter(name: "", type: !1) +; CHECK-NEXT: !3 = !MDTemplateTypeParameter(type: !1) !2 = !MDTemplateTypeParameter(name: "Ty", type: !1) !3 = !MDTemplateTypeParameter(type: !1) !4 = !MDTemplateTypeParameter(name: "", type: !1) -; CHECK-NEXT: !4 = !MDTemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "V", type: !1, value: i32 7) -; CHECK-NEXT: !5 = !MDTemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "", type: !1, value: i32 7) -!5 = !MDTemplateValueParameter(tag: DW_TAG_template_value_parameter, - name: "V", type: !1, value: i32 7) -!6 = !MDTemplateValueParameter(tag: DW_TAG_template_value_parameter, - type: !1, value: i32 7) +; CHECK-NEXT: !4 = !MDTemplateValueParameter(name: "V", type: !1, value: i32 7) +; CHECK-NEXT: !5 = !MDTemplateValueParameter(type: !1, value: i32 7) +; CHECK-NEXT: !6 = !MDTemplateValueParameter(tag: DW_TAG_GNU_template_template_param, name: "param", type: !1, value: !"template") +!5 = !MDTemplateValueParameter(name: "V", type: !1, value: i32 7) +!6 = !MDTemplateValueParameter(type: !1, value: i32 7) !7 = !MDTemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "", type: !1, value: i32 7) +!8 = !MDTemplateValueParameter(tag: DW_TAG_GNU_template_template_param, name: "param", type: !1, value: !"template") diff --git a/test/Assembler/mdtype-large-values.ll b/test/Assembler/mdtype-large-values.ll index 287e862..b2b0a87 100644 --- a/test/Assembler/mdtype-large-values.ll +++ b/test/Assembler/mdtype-large-values.ll @@ -4,7 +4,7 @@ ; CHECK: !named = !{!0, !1, !2} !named = !{!0, !1, !2} -; CHECK: !0 = !MDBasicType(tag: DW_TAG_base_type, name: "name", size: 18446744073709551615, align: 18446744073709551614, encoding: DW_ATE_unsigned_char) +; CHECK: !0 = !MDBasicType(name: "name", size: 18446744073709551615, align: 18446744073709551614, encoding: DW_ATE_unsigned_char) ; CHECK-NEXT: !1 = !MDDerivedType(tag: DW_TAG_pointer_type, baseType: !0, size: 18446744073709551615, align: 18446744073709551614, offset: 18446744073709551613) ; CHECK-NEXT: !2 = !MDCompositeType(tag: DW_TAG_array_type, baseType: !0, size: 18446744073709551615, align: 18446744073709551614, offset: 18446744073709551613) !0 = !MDBasicType(tag: DW_TAG_base_type, name: "name", size: 18446744073709551615, align: 18446744073709551614, encoding: DW_ATE_unsigned_char) diff --git a/test/Assembler/metadata-function-local.ll b/test/Assembler/metadata-function-local.ll new file mode 100644 index 0000000..9768e34 --- /dev/null +++ b/test/Assembler/metadata-function-local.ll @@ -0,0 +1,20 @@ +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s + +declare void @llvm.metadata(metadata) + +define void @foo(i32 %arg) { +entry: + %before = alloca i32 + call void @llvm.metadata(metadata i32 %arg) + call void @llvm.metadata(metadata i32* %after) + call void @llvm.metadata(metadata i32* %before) + %after = alloca i32 + ret void + +; CHECK: %before = alloca i32 +; CHECK: call void @llvm.metadata(metadata i32 %arg) +; CHECK: call void @llvm.metadata(metadata i32* %after) +; CHECK: call void @llvm.metadata(metadata i32* %before) +; CHECK: %after = alloca i32 +} diff --git a/test/Assembler/metadata.ll b/test/Assembler/metadata.ll index e2c5923..b483fc3 100644 --- a/test/Assembler/metadata.ll +++ b/test/Assembler/metadata.ll @@ -12,7 +12,7 @@ define void @test() { } !0 = !MDLocation(line: 662302, column: 26, scope: !1) -!1 = !{i32 4, !"foo"} +!1 = !MDSubprogram(name: "foo") declare void @llvm.dbg.func.start(metadata) nounwind readnone diff --git a/test/Assembler/numbered-values.ll b/test/Assembler/numbered-values.ll index 70b6377..0b14c68 100644 --- a/test/Assembler/numbered-values.ll +++ b/test/Assembler/numbered-values.ll @@ -9,7 +9,7 @@ entry: %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] + %1 = load i32, 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 diff --git a/test/Assembler/unnamed.ll b/test/Assembler/unnamed.ll index 099a15a..7f79e5c 100644 --- a/test/Assembler/unnamed.ll +++ b/test/Assembler/unnamed.ll @@ -16,7 +16,7 @@ module asm "this is another inline asm block" @3 = global x86_fp80 0xK4001E000000000000000 define float @foo(%0* %p) nounwind { - %t = load %0* %p ; <%0> [#uses=2] + %t = load %0, %0* %p ; <%0> [#uses=2] %s = extractvalue %0 %t, 1, 0 ; <float> [#uses=1] %r = insertvalue %0 %t, double 2.000000e+00, 1, 1; <%0> [#uses=1] store %0 %r, %0* %p diff --git a/test/Assembler/unsized-recursive-type.ll b/test/Assembler/unsized-recursive-type.ll new file mode 100644 index 0000000..b6d93fa --- /dev/null +++ b/test/Assembler/unsized-recursive-type.ll @@ -0,0 +1,9 @@ +; RUN: not llvm-as < %s 2>&1 | FileCheck %s + +; CHECK: base element of getelementptr must be sized + +%myTy = type { %myTy } +define void @foo(%myTy* %p){ + %0 = getelementptr %myTy, %myTy* %p, i32 0 + ret void +} diff --git a/test/Assembler/upgrade-loop-metadata.ll b/test/Assembler/upgrade-loop-metadata.ll index 0852469..d88cb3e 100644 --- a/test/Assembler/upgrade-loop-metadata.ll +++ b/test/Assembler/upgrade-loop-metadata.ll @@ -14,7 +14,7 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 16 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !1 @@ -22,7 +22,7 @@ for.body: ; preds = %for.cond br label %for.inc for.inc: ; preds = %for.body - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %inc = add nsw i32 %1, 1 store i32 %inc, i32* %i, align 4 br label %for.cond diff --git a/test/Assembler/uselistorder.ll b/test/Assembler/uselistorder.ll index be5ee70..2475fc4 100644 --- a/test/Assembler/uselistorder.ll +++ b/test/Assembler/uselistorder.ll @@ -4,7 +4,7 @@ ; 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) +@b = alias i1* getelementptr ([4 x i1], [4 x i1]* @a, i64 0, i64 2) ; Check use-list order of constants used by globals. @glob1 = global i5 7 @@ -48,9 +48,9 @@ first: define i1 @loada() { entry: - %a = load i1* getelementptr ([4 x i1]* @a, i64 0, i64 2) + %a = load i1, i1* getelementptr ([4 x i1], [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 } +uselistorder i1* getelementptr ([4 x i1], [4 x i1]* @a, i64 0, i64 2), { 1, 0 } diff --git a/test/Assembler/uselistorder_bb.ll b/test/Assembler/uselistorder_bb.ll index 11ae57b..4da85bc 100644 --- a/test/Assembler/uselistorder_bb.ll +++ b/test/Assembler/uselistorder_bb.ll @@ -4,11 +4,11 @@ ; 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) +@ba2 = constant i8* getelementptr (i8, i8* blockaddress (@bafunc2, %bb), i61 0) +@ba3 = constant i8* getelementptr (i8, i8* blockaddress (@bafunc2, %bb), i61 0) define i8* @babefore() { - ret i8* getelementptr (i8* blockaddress (@bafunc2, %bb), i61 0) + ret i8* getelementptr (i8, i8* blockaddress (@bafunc2, %bb), i61 0) bb1: ret i8* blockaddress (@bafunc1, %bb) bb2: |