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/Linker | |
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/Linker')
62 files changed, 896 insertions, 716 deletions
diff --git a/test/Linker/2002-08-20-ConstantExpr.ll b/test/Linker/2002-08-20-ConstantExpr.ll index 5672014..f821793 100644 --- a/test/Linker/2002-08-20-ConstantExpr.ll +++ b/test/Linker/2002-08-20-ConstantExpr.ll @@ -5,5 +5,5 @@ ; RUN: llvm-link %t.LinkTest.bc %t.bc @work = global i32 4 ; <i32*> [#uses=1] -@test = global i32* getelementptr (i32* @work, i64 1) ; <i32**> [#uses=0] +@test = global i32* getelementptr (i32, i32* @work, i64 1) ; <i32**> [#uses=0] diff --git a/test/Linker/2004-05-07-TypeResolution1.ll b/test/Linker/2004-05-07-TypeResolution1.ll index 4cff9ac..b8ce2d9 100644 --- a/test/Linker/2004-05-07-TypeResolution1.ll +++ b/test/Linker/2004-05-07-TypeResolution1.ll @@ -30,6 +30,6 @@ declare void @func(%struct2*) define void @tty_init() { entry: - store volatile void (%struct2*)* @func, void (%struct2*)** getelementptr (%struct1* @driver1, i64 0, i32 1) + store volatile void (%struct2*)* @func, void (%struct2*)** getelementptr (%struct1, %struct1* @driver1, i64 0, i32 1) ret void } diff --git a/test/Linker/2004-05-07-TypeResolution2.ll b/test/Linker/2004-05-07-TypeResolution2.ll index 3807127..2b67276 100644 --- a/test/Linker/2004-05-07-TypeResolution2.ll +++ b/test/Linker/2004-05-07-TypeResolution2.ll @@ -8,8 +8,8 @@ target datalayout = "e-p:32:32" define internal void @f1(%struct1* %tty) { loopentry.preheader: - %tmp.2.i.i = getelementptr %struct1* %tty, i64 0, i32 1 ; <void (%struct2*)**> [#uses=1] - %tmp.3.i.i = load volatile void (%struct2*)** %tmp.2.i.i ; <void (%struct2*)*> [#uses=0] + %tmp.2.i.i = getelementptr %struct1, %struct1* %tty, i64 0, i32 1 ; <void (%struct2*)**> [#uses=1] + %tmp.3.i.i = load volatile void (%struct2*)*, void (%struct2*)** %tmp.2.i.i ; <void (%struct2*)*> [#uses=0] ret void } diff --git a/test/Linker/2008-03-05-AliasReference.ll b/test/Linker/2008-03-05-AliasReference.ll index 8ce1ccb..0784794 100644 --- a/test/Linker/2008-03-05-AliasReference.ll +++ b/test/Linker/2008-03-05-AliasReference.ll @@ -12,6 +12,6 @@ target triple = "x86_64-unknown-linux-gnu" define i32 @baz() nounwind { entry: - %tmp1 = load i32* @bar, align 4 ; <i32> [#uses=1] + %tmp1 = load i32, i32* @bar, align 4 ; <i32> [#uses=1] ret i32 %tmp1 } diff --git a/test/Linker/2009-09-03-mdnode.ll b/test/Linker/2009-09-03-mdnode.ll index 1f308e7..bdb2b1e 100644 --- a/test/Linker/2009-09-03-mdnode.ll +++ b/test/Linker/2009-09-03-mdnode.ll @@ -14,7 +14,7 @@ entry: br label %return return: ; preds = %entry - %0 = load i32* %retval ; <i32> [#uses=1] + %0 = load i32, i32* %retval ; <i32> [#uses=1] call void @llvm.dbg.stoppoint(i32 5, i32 1, metadata !1) call void @llvm.dbg.region.end(metadata !0) ret i32 %0 @@ -26,6 +26,6 @@ declare void @llvm.dbg.stoppoint(i32, i32, metadata) nounwind readnone declare void @llvm.dbg.region.end(metadata) nounwind readnone -!0 = !{!"0x2e\00main\00main\00main\002\000\001\000\006\000\000\000", i32 0, !1, null, null, null, null, null} ; [ DW_TAG_subprogram ] -!1 = !{!"0x11\0012\00ellcc 0.1.0\001\00\000\00\000", !2, null, null, null, null, null} ; [ DW_TAG_compile_unit ] -!2 = !{!"a.c", !"/home/rich/ellcc/test/source"} +!0 = !MDSubprogram(name: "main", linkageName: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scope: !1) +!1 = !MDCompileUnit(language: DW_LANG_C99, producer: "ellcc 0.1.0", isOptimized: true, emissionKind: 0, file: !2) +!2 = !MDFile(filename: "a.c", directory: "/home/rich/ellcc/test/source") diff --git a/test/Linker/2009-09-03-mdnode2.ll b/test/Linker/2009-09-03-mdnode2.ll index 68e3294..3b046a9 100644 --- a/test/Linker/2009-09-03-mdnode2.ll +++ b/test/Linker/2009-09-03-mdnode2.ll @@ -9,7 +9,7 @@ entry: br label %return return: ; preds = %entry - %0 = load i32* %retval ; <i32> [#uses=1] + %0 = load i32, i32* %retval ; <i32> [#uses=1] call void @llvm.dbg.stoppoint(i32 3, i32 1, metadata !1) call void @llvm.dbg.region.end(metadata !0) ret i32 %0 @@ -21,6 +21,6 @@ declare void @llvm.dbg.stoppoint(i32, i32, metadata) nounwind readnone declare void @llvm.dbg.region.end(metadata) nounwind readnone -!0 = !{!"0x2e\00f\00f\00f\001\000\001\000\006\000\000\000", i32 0, !1, null, null, null, null, null} ; [ DW_TAG_subprogram ] -!1 = !{!"0x11\0012\00ellcc 0.1.0\001\00\000\00\000", !2, null, null, null, null, null} ; [ DW_TAG_compile_unit ] -!2 = !{!"b.c", !"/home/rich/ellcc/test/source"} +!0 = !MDSubprogram(name: "f", linkageName: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scope: !1) +!1 = !MDCompileUnit(language: DW_LANG_C99, producer: "ellcc 0.1.0", isOptimized: true, emissionKind: 0, file: !2) +!2 = !MDFile(filename: "b.c", directory: "/home/rich/ellcc/test/source") diff --git a/test/Linker/2011-08-04-DebugLoc.ll b/test/Linker/2011-08-04-DebugLoc.ll index 85b9e17..18fa7da 100644 --- a/test/Linker/2011-08-04-DebugLoc.ll +++ b/test/Linker/2011-08-04-DebugLoc.ll @@ -17,15 +17,15 @@ define i32 @foo() nounwind ssp { !llvm.module.flags = !{!11} !llvm.dbg.sp = !{!1} -!0 = !{!"0x11\0012\00Apple clang version 3.0 (tags/Apple/clang-209.11) (based on LLVM 3.0svn)\001\00\000\00\000", !8, !9, !9, !10, null, null} ; [ DW_TAG_compile_unit ] -!1 = !{!"0x2e\00foo\00foo\00\002\000\001\000\006\000\000\000", !8, !2, !3, null, i32 ()* @foo, null, null, null} ; [ DW_TAG_subprogram ] [line 2] [def] [scope 0] [foo] -!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 ] +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "Apple clang version 3.0 (tags/Apple/clang-209.11) (based on LLVM 3.0svn)", isOptimized: true, emissionKind: 0, file: !8, enums: !9, retainedTypes: !9, subprograms: !10) +!1 = !MDSubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !8, scope: !2, type: !3, function: i32 ()* @foo) +!2 = !MDFile(filename: "a.c", directory: "/private/tmp") +!3 = !MDSubroutineType(types: !4) !4 = !{!5} -!5 = !{!"0x24\00int\000\0032\0032\000\000\005", null, !0} ; [ DW_TAG_base_type ] +!5 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !6 = !MDLocation(line: 2, column: 13, scope: !7) -!7 = !{!"0xb\002\0011\000", !8, !1} ; [ DW_TAG_lexical_block ] -!8 = !{!"a.c", !"/private/tmp"} +!7 = distinct !MDLexicalBlock(line: 2, column: 11, file: !8, scope: !1) +!8 = !MDFile(filename: "a.c", directory: "/private/tmp") !9 = !{i32 0} !10 = !{!1} -!11 = !{i32 1, !"Debug Info Version", i32 2} +!11 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Linker/2011-08-04-DebugLoc2.ll b/test/Linker/2011-08-04-DebugLoc2.ll index a3cd001..93eb61d 100644 --- a/test/Linker/2011-08-04-DebugLoc2.ll +++ b/test/Linker/2011-08-04-DebugLoc2.ll @@ -14,15 +14,15 @@ define i32 @bar() nounwind ssp { !llvm.module.flags = !{!11} !llvm.dbg.sp = !{!1} -!0 = !{!"0x11\0012\00Apple clang version 3.0 (tags/Apple/clang-209.11) (based on LLVM 3.0svn)\001\00\000\00\000", !8, !9, !9, !10, null, null} ; [ DW_TAG_compile_unit ] -!1 = !{!"0x2e\00bar\00bar\00\001\000\001\000\006\000\000\000", !8, !2, !3, null, i32 ()* @bar, null, null, null} ; [ DW_TAG_subprogram ] [line 1] [def] [scope 0] [bar] -!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 ] +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "Apple clang version 3.0 (tags/Apple/clang-209.11) (based on LLVM 3.0svn)", isOptimized: true, emissionKind: 0, file: !8, enums: !9, retainedTypes: !9, subprograms: !10) +!1 = !MDSubprogram(name: "bar", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !8, scope: !2, type: !3, function: i32 ()* @bar) +!2 = !MDFile(filename: "b.c", directory: "/private/tmp") +!3 = !MDSubroutineType(types: !4) !4 = !{!5} -!5 = !{!"0x24\00int\000\0032\0032\000\000\005", null, !0} ; [ DW_TAG_base_type ] +!5 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !6 = !MDLocation(line: 1, column: 13, scope: !7) -!7 = !{!"0xb\001\0011\000", !8, !1} ; [ DW_TAG_lexical_block ] -!8 = !{!"b.c", !"/private/tmp"} +!7 = distinct !MDLexicalBlock(line: 1, column: 11, file: !8, scope: !1) +!8 = !MDFile(filename: "b.c", directory: "/private/tmp") !9 = !{i32 0} !10 = !{!1} -!11 = !{i32 1, !"Debug Info Version", i32 2} +!11 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Linker/2011-08-04-Metadata.ll b/test/Linker/2011-08-04-Metadata.ll index da98f20..2a1711a 100644 --- a/test/Linker/2011-08-04-Metadata.ll +++ b/test/Linker/2011-08-04-Metadata.ll @@ -2,8 +2,12 @@ ; RUN: llvm-dis < %t.bc | FileCheck %s ; Test if internal global variable's debug info is merged appropriately or not. -;CHECK: !"0x34\00x\00x\00\002\001\001", !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, i32* @x} -;CHECK: !"0x34\00x\00x\00\001\001\001", !{{[0-9]+}}, !{{[0-9]+}}, !{{[0-9]+}}, i32* @x1} +; CHECK: !MDGlobalVariable(name: "x", +; CHECK-NOT: linkageName: +; CHECK-SAME: variable: i32* @x{{[,)]}} +; CHECK: !MDGlobalVariable(name: "x", +; CHECK-NOT: linkageName: +; CHECK-SAME: variable: i32* @x1{{[,)]}} 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-macosx10.7.0" @@ -20,15 +24,15 @@ entry: !llvm.dbg.sp = !{!1} !llvm.dbg.gv = !{!5} -!0 = !{!"0x11\0012\00clang version 3.0 ()\001\00\000\00\000", !9, !4, !4, !10, null, null} ; [ DW_TAG_compile_unit ] -!1 = !{!"0x2e\00foo\00foo\00\003\000\001\000\006\000\000\000", !9, !2, !3, null, void ()* @foo, null, null, null} ; [ DW_TAG_subprogram ] [line 3] [def] [scope 0] [foo] -!2 = !{!"0x29", !9} ; [ DW_TAG_file_type ] -!3 = !{!"0x15\00\000\000\000\000\000\000", !9, !2, null, !4, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 ()", isOptimized: true, emissionKind: 0, file: !9, enums: !4, retainedTypes: !4, subprograms: !10) +!1 = !MDSubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !9, scope: !2, type: !3, function: void ()* @foo) +!2 = !MDFile(filename: "/tmp/one.c", directory: "/Volumes/Lalgate/Slate/D") +!3 = !MDSubroutineType(types: !4) !4 = !{null} -!5 = !{!"0x34\00x\00x\00\002\001\001", !0, !2, !6, i32* @x} ; [ DW_TAG_variable ] -!6 = !{!"0x24\00int\000\0032\0032\000\000\005", null, !0} ; [ DW_TAG_base_type ] +!5 = !MDGlobalVariable(name: "x", line: 2, isLocal: true, isDefinition: true, scope: !0, file: !2, type: !6, variable: i32* @x) +!6 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !7 = !MDLocation(line: 3, column: 14, scope: !8) -!8 = !{!"0xb\003\0012\000", !9, !1} ; [ DW_TAG_lexical_block ] -!9 = !{!"/tmp/one.c", !"/Volumes/Lalgate/Slate/D"} +!8 = distinct !MDLexicalBlock(line: 3, column: 12, file: !9, scope: !1) +!9 = !MDFile(filename: "/tmp/one.c", directory: "/Volumes/Lalgate/Slate/D") !10 = !{!1} -!11 = !{i32 1, !"Debug Info Version", i32 2} +!11 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Linker/2011-08-04-Metadata2.ll b/test/Linker/2011-08-04-Metadata2.ll index fb196d9..e62c122 100644 --- a/test/Linker/2011-08-04-Metadata2.ll +++ b/test/Linker/2011-08-04-Metadata2.ll @@ -19,15 +19,15 @@ entry: !llvm.dbg.sp = !{!1} !llvm.dbg.gv = !{!5} -!0 = !{!"0x11\0012\00clang version 3.0 ()\001\00\000\00\000", !9, !4, !4, !10, null, null} ; [ DW_TAG_compile_unit ] -!1 = !{!"0x2e\00bar\00bar\00\002\000\001\000\006\000\000\000", !9, !2, !3, null, void ()* @bar, null, null, null} ; [ DW_TAG_subprogram ] [line 2] [def] [scope 0] [bar] -!2 = !{!"0x29", !9} ; [ DW_TAG_file_type ] -!3 = !{!"0x15\00\000\000\000\000\000\000", !9, !2, null, !4, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 ()", isOptimized: true, emissionKind: 0, file: !9, enums: !4, retainedTypes: !4, subprograms: !10) +!1 = !MDSubprogram(name: "bar", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !9, scope: !2, type: !3, function: void ()* @bar) +!2 = !MDFile(filename: "/tmp/two.c", directory: "/Volumes/Lalgate/Slate/D") +!3 = !MDSubroutineType(types: !4) !4 = !{null} -!5 = !{!"0x34\00x\00x\00\001\001\001", !0, !2, !6, i32* @x} ; [ DW_TAG_variable ] -!6 = !{!"0x24\00int\000\0032\0032\000\000\005", null, !0} ; [ DW_TAG_base_type ] +!5 = !MDGlobalVariable(name: "x", line: 1, isLocal: true, isDefinition: true, scope: !0, file: !2, type: !6, variable: i32* @x) +!6 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !7 = !MDLocation(line: 2, column: 14, scope: !8) -!8 = !{!"0xb\002\0012\000", !9, !1} ; [ DW_TAG_lexical_block ] -!9 = !{!"/tmp/two.c", !"/Volumes/Lalgate/Slate/D"} +!8 = distinct !MDLexicalBlock(line: 2, column: 12, file: !9, scope: !1) +!9 = !MDFile(filename: "/tmp/two.c", directory: "/Volumes/Lalgate/Slate/D") !10 = !{!1} -!11 = !{i32 1, !"Debug Info Version", i32 2} +!11 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Linker/2011-08-18-unique-class-type.ll b/test/Linker/2011-08-18-unique-class-type.ll index a8f1350..4ffb249 100644 --- a/test/Linker/2011-08-18-unique-class-type.ll +++ b/test/Linker/2011-08-18-unique-class-type.ll @@ -11,7 +11,7 @@ target triple = "x86_64-apple-macosx10.7.0" define void @_Z3fooN2N11AE() nounwind uwtable ssp { entry: %mya = alloca %"class.N1::A", align 1 - call void @llvm.dbg.declare(metadata %"class.N1::A"* %mya, metadata !9, metadata !{!"0x102"}), !dbg !13 + call void @llvm.dbg.declare(metadata %"class.N1::A"* %mya, metadata !9, metadata !MDExpression()), !dbg !13 ret void, !dbg !14 } @@ -20,21 +20,21 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!18} -!0 = !{!"0x11\004\00clang version 3.0 (trunk 137954)\001\00\000\00\000", !16, !2, !2, !3, !2, null} ; [ DW_TAG_compile_unit ] +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 (trunk 137954)", isOptimized: true, emissionKind: 0, file: !16, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2) !1 = !{!2} !2 = !{i32 0} !3 = !{!5} -!5 = !{!"0x2e\00foo\00foo\00_Z3fooN2N11AE\004\000\001\000\006\00256\000\000", !16, !6, !7, null, void ()* @_Z3fooN2N11AE, null, null, null} ; [ DW_TAG_subprogram ] [line 4] [def] [scope 0] [foo] -!6 = !{!"0x29", !16} ; [ DW_TAG_file_type ] -!7 = !{!"0x15\00\000\000\000\000\000\000", !16, !6, null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!5 = !MDSubprogram(name: "foo", linkageName: "_Z3fooN2N11AE", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !16, scope: !6, type: !7, function: void ()* @_Z3fooN2N11AE) +!6 = !MDFile(filename: "n1.c", directory: "/private/tmp") +!7 = !MDSubroutineType(types: !8) !8 = !{null} -!9 = !{!"0x101\00mya\0016777220\000", !5, !6, !10} ; [ DW_TAG_arg_variable ] -!10 = !{!"0x2\00A\003\008\008\000\000\000", !17, !11, null, !2, null, null, null} ; [ DW_TAG_class_type ] [A] [line 3, size 8, align 8, offset 0] [def] [from ] -!11 = !{!"0x39\00N1\002", !17, null} ; [ DW_TAG_namespace ] -!12 = !{!"0x29", !17} ; [ DW_TAG_file_type ] +!9 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "mya", line: 4, arg: 1, scope: !5, file: !6, type: !10) +!10 = !MDCompositeType(tag: DW_TAG_class_type, name: "A", line: 3, size: 8, align: 8, file: !17, scope: !11, elements: !2) +!11 = !MDNamespace(name: "N1", line: 2, file: !17, scope: null) +!12 = !MDFile(filename: "./n.h", directory: "/private/tmp") !13 = !MDLocation(line: 4, column: 12, scope: !5) !14 = !MDLocation(line: 4, column: 18, scope: !15) -!15 = !{!"0xb\004\0017\000", !16, !5} ; [ DW_TAG_lexical_block ] -!16 = !{!"n1.c", !"/private/tmp"} -!17 = !{!"./n.h", !"/private/tmp"} -!18 = !{i32 1, !"Debug Info Version", i32 2} +!15 = distinct !MDLexicalBlock(line: 4, column: 17, file: !16, scope: !5) +!16 = !MDFile(filename: "n1.c", directory: "/private/tmp") +!17 = !MDFile(filename: "./n.h", directory: "/private/tmp") +!18 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Linker/2011-08-18-unique-class-type2.ll b/test/Linker/2011-08-18-unique-class-type2.ll index dd0df58..da75160 100644 --- a/test/Linker/2011-08-18-unique-class-type2.ll +++ b/test/Linker/2011-08-18-unique-class-type2.ll @@ -9,7 +9,7 @@ target triple = "x86_64-apple-macosx10.7.0" define void @_Z3barN2N11AE() nounwind uwtable ssp { entry: %youra = alloca %"class.N1::A", align 1 - call void @llvm.dbg.declare(metadata %"class.N1::A"* %youra, metadata !9, metadata !{!"0x102"}), !dbg !13 + call void @llvm.dbg.declare(metadata %"class.N1::A"* %youra, metadata !9, metadata !MDExpression()), !dbg !13 ret void, !dbg !14 } @@ -18,21 +18,21 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!18} -!0 = !{!"0x11\004\00clang version 3.0 (trunk 137954)\001\00\000\00\000", !16, !2, !2, !3, !2, null} ; [ DW_TAG_compile_unit ] +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 (trunk 137954)", isOptimized: true, emissionKind: 0, file: !16, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2) !1 = !{!2} !2 = !{i32 0} !3 = !{!5} -!5 = !{!"0x2e\00bar\00bar\00_Z3barN2N11AE\004\000\001\000\006\00256\000\000", i32 0, !6, !7, null, void ()* @_Z3barN2N11AE, null, null, null} ; [ DW_TAG_subprogram ] [line 4] [def] [scope 0] [bar] -!6 = !{!"0x29", !16} ; [ DW_TAG_file_type ] -!7 = !{!"0x15\00\000\000\000\000\000\000", !16, !6, null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!5 = !MDSubprogram(name: "bar", linkageName: "_Z3barN2N11AE", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scope: !6, type: !7, function: void ()* @_Z3barN2N11AE) +!6 = !MDFile(filename: "n2.c", directory: "/private/tmp") +!7 = !MDSubroutineType(types: !8) !8 = !{null} -!9 = !{!"0x101\00youra\0016777220\000", !5, !6, !10} ; [ DW_TAG_arg_variable ] -!10 = !{!"0x2\00A\003\008\008\000\000\000", !17, !11, null, !2, null, null, null} ; [ DW_TAG_class_type ] [A] [line 3, size 8, align 8, offset 0] [def] [from ] -!11 = !{!"0x39\00N1\002", !17, null} ; [ DW_TAG_namespace ] -!12 = !{!"0x29", !17} ; [ DW_TAG_file_type ] +!9 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "youra", line: 4, arg: 1, scope: !5, file: !6, type: !10) +!10 = !MDCompositeType(tag: DW_TAG_class_type, name: "A", line: 3, size: 8, align: 8, file: !17, scope: !11, elements: !2) +!11 = !MDNamespace(name: "N1", line: 2, file: !17, scope: null) +!12 = !MDFile(filename: "./n.h", directory: "/private/tmp") !13 = !MDLocation(line: 4, column: 12, scope: !5) !14 = !MDLocation(line: 4, column: 20, scope: !15) -!15 = !{!"0xb\004\0019\000", !16, !5} ; [ DW_TAG_lexical_block ] -!16 = !{!"n2.c", !"/private/tmp"} -!17 = !{!"./n.h", !"/private/tmp"} -!18 = !{i32 1, !"Debug Info Version", i32 2} +!15 = distinct !MDLexicalBlock(line: 4, column: 19, file: !16, scope: !5) +!16 = !MDFile(filename: "n2.c", directory: "/private/tmp") +!17 = !MDFile(filename: "./n.h", directory: "/private/tmp") +!18 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Linker/2011-08-18-unique-debug-type.ll b/test/Linker/2011-08-18-unique-debug-type.ll index c1b3a1d..7184d52 100644 --- a/test/Linker/2011-08-18-unique-debug-type.ll +++ b/test/Linker/2011-08-18-unique-debug-type.ll @@ -1,6 +1,6 @@ ; RUN: llvm-link %s %p/2011-08-18-unique-debug-type2.ll -S -o - | FileCheck %s ; Test to check only one MDNode for "int" after linking. -; CHECK: !"0x24\00int\00{{.*}}" +; CHECK: !MDBasicType(name: "int" 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-macosx10.7.0" @@ -12,16 +12,16 @@ entry: !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!13} -!0 = !{!"0x11\0012\00clang version 3.0 (trunk 137954)\001\00\000\00\000", !12, !2, !2, !3, !2, null} ; [ DW_TAG_compile_unit ] +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 137954)", isOptimized: true, emissionKind: 0, file: !12, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2) !1 = !{!2} !2 = !{i32 0} !3 = !{!5} -!5 = !{!"0x2e\00foo\00foo\00\001\000\001\000\006\000\000\000", !12, !6, !7, null, i32 ()* @foo, null, null, null} ; [ DW_TAG_subprogram ] [line 1] [def] [scope 0] [foo] -!6 = !{!"0x29", !12} ; [ DW_TAG_file_type ] -!7 = !{!"0x15\00\000\000\000\000\000\000", !12, !6, null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!5 = !MDSubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !12, scope: !6, type: !7, function: i32 ()* @foo) +!6 = !MDFile(filename: "one.c", directory: "/private/tmp") +!7 = !MDSubroutineType(types: !8) !8 = !{!9} -!9 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] +!9 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !10 = !MDLocation(line: 1, column: 13, scope: !11) -!11 = !{!"0xb\001\0011\000", !12, !5} ; [ DW_TAG_lexical_block ] -!12 = !{!"one.c", !"/private/tmp"} -!13 = !{i32 1, !"Debug Info Version", i32 2} +!11 = distinct !MDLexicalBlock(line: 1, column: 11, file: !12, scope: !5) +!12 = !MDFile(filename: "one.c", directory: "/private/tmp") +!13 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Linker/2011-08-18-unique-debug-type2.ll b/test/Linker/2011-08-18-unique-debug-type2.ll index 49c0a5c..2b04560 100644 --- a/test/Linker/2011-08-18-unique-debug-type2.ll +++ b/test/Linker/2011-08-18-unique-debug-type2.ll @@ -12,16 +12,16 @@ entry: !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!13} -!0 = !{!"0x11\0012\00clang version 3.0 (trunk 137954)\001\00\000\00\000", !12, !2, !2, !3, !2, null} ; [ DW_TAG_compile_unit ] +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 137954)", isOptimized: true, emissionKind: 0, file: !12, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2) !1 = !{!2} !2 = !{i32 0} !3 = !{!5} -!5 = !{!"0x2e\00bar\00bar\00\001\000\001\000\006\000\000\000", !12, !6, !7, null, i32 ()* @bar, null, null, null} ; [ DW_TAG_subprogram ] [line 1] [def] [scope 0] [bar] -!6 = !{!"0x29", !12} ; [ DW_TAG_file_type ] -!7 = !{!"0x15\00\000\000\000\000\000\000", !12, !6, null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!5 = !MDSubprogram(name: "bar", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !12, scope: !6, type: !7, function: i32 ()* @bar) +!6 = !MDFile(filename: "two.c", directory: "/private/tmp") +!7 = !MDSubroutineType(types: !8) !8 = !{!9} -!9 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] +!9 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !10 = !MDLocation(line: 1, column: 13, scope: !11) -!11 = !{!"0xb\001\0011\000", !12, !5} ; [ DW_TAG_lexical_block ] -!12 = !{!"two.c", !"/private/tmp"} -!13 = !{i32 1, !"Debug Info Version", i32 2} +!11 = distinct !MDLexicalBlock(line: 1, column: 11, file: !12, scope: !5) +!12 = !MDFile(filename: "two.c", directory: "/private/tmp") +!13 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Linker/2011-08-22-ResolveAlias.ll b/test/Linker/2011-08-22-ResolveAlias.ll deleted file mode 100644 index d6df82d..0000000 --- a/test/Linker/2011-08-22-ResolveAlias.ll +++ /dev/null @@ -1,89 +0,0 @@ -; PR10663 -; RUN: llvm-link %s %p/2011-08-22-ResolveAlias2.ll - -%union.pthread_attr_t = type { [56 x i8] } -%union.pthread_mutex_t = type { [40 x i8] } -%struct.timespec = type { i64, i64 } -%union.pthread_mutexattr_t = type { [4 x i8] } -%union.pthread_cond_t = type { [48 x i8] } - -@_ZL20__gthrw_pthread_oncePiPFvvE = weak alias i32 (i32*, void ()*)* @pthread_once -@_ZL27__gthrw_pthread_getspecificj = weak alias i8* (i32)* @pthread_getspecific -@_ZL27__gthrw_pthread_setspecificjPKv = weak alias i32 (i32, i8*)* @pthread_setspecific -@_ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = weak alias i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create -@_ZL20__gthrw_pthread_joinmPPv = weak alias i32 (i64, i8**)* @pthread_join -@_ZL21__gthrw_pthread_equalmm = weak alias i32 (i64, i64)* @pthread_equal -@_ZL20__gthrw_pthread_selfv = weak alias i64 ()* @pthread_self -@_ZL22__gthrw_pthread_detachm = weak alias i32 (i64)* @pthread_detach -@_ZL22__gthrw_pthread_cancelm = weak alias i32 (i64)* @pthread_cancel -@_ZL19__gthrw_sched_yieldv = weak alias i32 ()* @sched_yield -@_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_lock -@_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_trylock -@_ZL31__gthrw_pthread_mutex_timedlockP15pthread_mutex_tPK8timespec = weak alias i32 (%union.pthread_mutex_t*, %struct.timespec*)* @pthread_mutex_timedlock -@_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_unlock -@_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = weak alias i32 (%union.pthread_mutex_t*, %union.pthread_mutexattr_t*)* @pthread_mutex_init -@_ZL29__gthrw_pthread_mutex_destroyP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_destroy -@_ZL30__gthrw_pthread_cond_broadcastP14pthread_cond_t = weak alias i32 (%union.pthread_cond_t*)* @pthread_cond_broadcast -@_ZL27__gthrw_pthread_cond_signalP14pthread_cond_t = weak alias i32 (%union.pthread_cond_t*)* @pthread_cond_signal -@_ZL25__gthrw_pthread_cond_waitP14pthread_cond_tP15pthread_mutex_t = weak alias i32 (%union.pthread_cond_t*, %union.pthread_mutex_t*)* @pthread_cond_wait -@_ZL30__gthrw_pthread_cond_timedwaitP14pthread_cond_tP15pthread_mutex_tPK8timespec = weak alias i32 (%union.pthread_cond_t*, %union.pthread_mutex_t*, %struct.timespec*)* @pthread_cond_timedwait -@_ZL28__gthrw_pthread_cond_destroyP14pthread_cond_t = weak alias i32 (%union.pthread_cond_t*)* @pthread_cond_destroy -@_ZL26__gthrw_pthread_key_createPjPFvPvE = weak alias i32 (i32*, void (i8*)*)* @pthread_key_create -@_ZL26__gthrw_pthread_key_deletej = weak alias i32 (i32)* @pthread_key_delete -@_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = weak alias i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_init -@_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = weak alias i32 (%union.pthread_mutexattr_t*, i32)* @pthread_mutexattr_settype -@_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = weak alias i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_destroy - -declare extern_weak i32 @pthread_once(i32*, void ()*) - -declare extern_weak i8* @pthread_getspecific(i32) - -declare extern_weak i32 @pthread_setspecific(i32, i8*) - -declare extern_weak i32 @pthread_create(i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*) - -declare extern_weak i32 @pthread_join(i64, i8**) - -declare extern_weak i32 @pthread_equal(i64, i64) - -declare extern_weak i64 @pthread_self() - -declare extern_weak i32 @pthread_detach(i64) - -declare extern_weak i32 @pthread_cancel(i64) - -declare extern_weak i32 @sched_yield() - -declare extern_weak i32 @pthread_mutex_lock(%union.pthread_mutex_t*) - -declare extern_weak i32 @pthread_mutex_trylock(%union.pthread_mutex_t*) - -declare extern_weak i32 @pthread_mutex_timedlock(%union.pthread_mutex_t*, %struct.timespec*) - -declare extern_weak i32 @pthread_mutex_unlock(%union.pthread_mutex_t*) - -declare extern_weak i32 @pthread_mutex_init(%union.pthread_mutex_t*, %union.pthread_mutexattr_t*) - -declare extern_weak i32 @pthread_mutex_destroy(%union.pthread_mutex_t*) - -declare extern_weak i32 @pthread_cond_broadcast(%union.pthread_cond_t*) - -declare extern_weak i32 @pthread_cond_signal(%union.pthread_cond_t*) - -declare extern_weak i32 @pthread_cond_wait(%union.pthread_cond_t*, %union.pthread_mutex_t*) - -declare extern_weak i32 @pthread_cond_timedwait(%union.pthread_cond_t*, %union.pthread_mutex_t*, %struct.timespec*) - -declare extern_weak i32 @pthread_cond_destroy(%union.pthread_cond_t*) - -declare extern_weak i32 @pthread_key_create(i32*, void (i8*)*) - -declare extern_weak i32 @pthread_key_delete(i32) - -declare extern_weak i32 @pthread_mutexattr_init(%union.pthread_mutexattr_t*) - -declare extern_weak i32 @pthread_mutexattr_settype(%union.pthread_mutexattr_t*, i32) - -declare extern_weak i32 @pthread_mutexattr_destroy(%union.pthread_mutexattr_t*) - -declare void @_GLOBAL__sub_I__ZN10BitBoard64coEv() nounwind uwtable diff --git a/test/Linker/2011-08-22-ResolveAlias2.ll b/test/Linker/2011-08-22-ResolveAlias2.ll deleted file mode 100644 index c380c23..0000000 --- a/test/Linker/2011-08-22-ResolveAlias2.ll +++ /dev/null @@ -1,146 +0,0 @@ -; This file is used by 2011-08-22-ResolveAlias.ll -; RUN: true - -%struct.HexxagonBoard = type { %struct.BitBoard64, %struct.BitBoard64 } -%struct.BitBoard64 = type { i32, i32 } -%union.pthread_attr_t = type { [56 x i8] } -%union.pthread_mutex_t = type { [40 x i8] } -%struct.timespec = type { i64, i64 } -%union.pthread_mutexattr_t = type { [4 x i8] } -%union.pthread_cond_t = type { [48 x i8] } - -@_ZN13HexxagonBoardC1ERKS_ = alias void (%struct.HexxagonBoard*, %struct.HexxagonBoard*)* @_ZN13HexxagonBoardC2ERKS_ -@_ZL20__gthrw_pthread_oncePiPFvvE = weak alias i32 (i32*, void ()*)* @pthread_once -@_ZL27__gthrw_pthread_getspecificj = weak alias i8* (i32)* @pthread_getspecific -@_ZL27__gthrw_pthread_setspecificjPKv = weak alias i32 (i32, i8*)* @pthread_setspecific -@_ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = weak alias i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create -@_ZL20__gthrw_pthread_joinmPPv = weak alias i32 (i64, i8**)* @pthread_join -@_ZL21__gthrw_pthread_equalmm = weak alias i32 (i64, i64)* @pthread_equal -@_ZL20__gthrw_pthread_selfv = weak alias i64 ()* @pthread_self -@_ZL22__gthrw_pthread_detachm = weak alias i32 (i64)* @pthread_detach -@_ZL22__gthrw_pthread_cancelm = weak alias i32 (i64)* @pthread_cancel -@_ZL19__gthrw_sched_yieldv = weak alias i32 ()* @sched_yield -@_ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_lock -@_ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_trylock -@_ZL31__gthrw_pthread_mutex_timedlockP15pthread_mutex_tPK8timespec = weak alias i32 (%union.pthread_mutex_t*, %struct.timespec*)* @pthread_mutex_timedlock -@_ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_unlock -@_ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = weak alias i32 (%union.pthread_mutex_t*, %union.pthread_mutexattr_t*)* @pthread_mutex_init -@_ZL29__gthrw_pthread_mutex_destroyP15pthread_mutex_t = weak alias i32 (%union.pthread_mutex_t*)* @pthread_mutex_destroy -@_ZL30__gthrw_pthread_cond_broadcastP14pthread_cond_t = weak alias i32 (%union.pthread_cond_t*)* @pthread_cond_broadcast -@_ZL27__gthrw_pthread_cond_signalP14pthread_cond_t = weak alias i32 (%union.pthread_cond_t*)* @pthread_cond_signal -@_ZL25__gthrw_pthread_cond_waitP14pthread_cond_tP15pthread_mutex_t = weak alias i32 (%union.pthread_cond_t*, %union.pthread_mutex_t*)* @pthread_cond_wait -@_ZL30__gthrw_pthread_cond_timedwaitP14pthread_cond_tP15pthread_mutex_tPK8timespec = weak alias i32 (%union.pthread_cond_t*, %union.pthread_mutex_t*, %struct.timespec*)* @pthread_cond_timedwait -@_ZL28__gthrw_pthread_cond_destroyP14pthread_cond_t = weak alias i32 (%union.pthread_cond_t*)* @pthread_cond_destroy -@_ZL26__gthrw_pthread_key_createPjPFvPvE = weak alias i32 (i32*, void (i8*)*)* @pthread_key_create -@_ZL26__gthrw_pthread_key_deletej = weak alias i32 (i32)* @pthread_key_delete -@_ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = weak alias i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_init -@_ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = weak alias i32 (%union.pthread_mutexattr_t*, i32)* @pthread_mutexattr_settype -@_ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = weak alias i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_destroy - -define void @_ZN13HexxagonBoardC2ERKS_(%struct.HexxagonBoard*, %struct.HexxagonBoard*) uwtable align 2 { - ret void -} - -define weak i32 @pthread_once(i32*, void ()*) { - ret i32 0 -} - -define weak i8* @pthread_getspecific(i32) { - ret i8* null -} - -define weak i32 @pthread_setspecific(i32, i8*) { - ret i32 0 -} - -define weak i32 @pthread_create(i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*) { - ret i32 0 -} - -define weak i32 @pthread_join(i64, i8**) { - ret i32 0 -} - -define weak i32 @pthread_equal(i64, i64) { - ret i32 0 -} - -define weak i64 @pthread_self() { - ret i64 0 -} - -define weak i32 @pthread_detach(i64) { - ret i32 0 -} - -define weak i32 @pthread_cancel(i64) { - ret i32 0 -} - -define weak i32 @sched_yield() { - ret i32 0 -} - -define weak i32 @pthread_mutex_lock(%union.pthread_mutex_t*) { - ret i32 0 -} - -define weak i32 @pthread_mutex_trylock(%union.pthread_mutex_t*) { - ret i32 0 -} - -define weak i32 @pthread_mutex_timedlock(%union.pthread_mutex_t*, %struct.timespec*) { - ret i32 0 -} - -define weak i32 @pthread_mutex_unlock(%union.pthread_mutex_t*) { - ret i32 0 -} - -define weak i32 @pthread_mutex_init(%union.pthread_mutex_t*, %union.pthread_mutexattr_t*) { - ret i32 0 -} - -define weak i32 @pthread_mutex_destroy(%union.pthread_mutex_t*) { - ret i32 0 -} - -define weak i32 @pthread_cond_broadcast(%union.pthread_cond_t*) { - ret i32 0 -} - -define weak i32 @pthread_cond_signal(%union.pthread_cond_t*) { - ret i32 0 -} - -define weak i32 @pthread_cond_wait(%union.pthread_cond_t*, %union.pthread_mutex_t*) { - ret i32 0 -} - -define weak i32 @pthread_cond_timedwait(%union.pthread_cond_t*, %union.pthread_mutex_t*, %struct.timespec*) { - ret i32 0 -} - -define weak i32 @pthread_cond_destroy(%union.pthread_cond_t*) { - ret i32 0 -} - -define weak i32 @pthread_key_create(i32*, void (i8*)*) { - ret i32 0 -} - -define weak i32 @pthread_key_delete(i32) { - ret i32 0 -} - -define weak i32 @pthread_mutexattr_init(%union.pthread_mutexattr_t*) { - ret i32 0 -} - -define weak i32 @pthread_mutexattr_settype(%union.pthread_mutexattr_t*, i32) { - ret i32 0 -} - -define weak i32 @pthread_mutexattr_destroy(%union.pthread_mutexattr_t*) { - ret i32 0 -} diff --git a/test/Linker/AppendingLinkage.ll b/test/Linker/AppendingLinkage.ll index 5beff5a..a3db5d2 100644 --- a/test/Linker/AppendingLinkage.ll +++ b/test/Linker/AppendingLinkage.ll @@ -7,10 +7,10 @@ ; CHECK: [i32 7, i32 4, i32 8] @X = appending global [2 x i32] [ i32 7, i32 4 ] ; <[2 x i32]*> [#uses=2] -@Y = global i32* getelementptr ([2 x i32]* @X, i64 0, i64 0) ; <i32**> [#uses=0] +@Y = global i32* getelementptr ([2 x i32], [2 x i32]* @X, i64 0, i64 0) ; <i32**> [#uses=0] define void @foo(i64 %V) { - %Y = getelementptr [2 x i32]* @X, i64 0, i64 %V ; <i32*> [#uses=0] + %Y = getelementptr [2 x i32], [2 x i32]* @X, i64 0, i64 %V ; <i32*> [#uses=0] ret void } diff --git a/test/Linker/DbgDeclare.ll b/test/Linker/DbgDeclare.ll index de5ac9e..9afb8fb 100644 --- a/test/Linker/DbgDeclare.ll +++ b/test/Linker/DbgDeclare.ll @@ -21,11 +21,11 @@ entry: %argv.addr = alloca i8**, align 8 store i32 0, i32* %retval store i32 %argc, i32* %argc.addr, align 4 - call void @llvm.dbg.declare(metadata i32* %argc.addr, metadata !14, metadata !{!"0x102"}), !dbg !15 + call void @llvm.dbg.declare(metadata i32* %argc.addr, metadata !14, metadata !MDExpression()), !dbg !15 store i8** %argv, i8*** %argv.addr, align 8 - call void @llvm.dbg.declare(metadata i8*** %argv.addr, metadata !16, metadata !{!"0x102"}), !dbg !15 - %0 = load i32* %argc.addr, align 4, !dbg !17 - %1 = load i8*** %argv.addr, align 8, !dbg !17 + call void @llvm.dbg.declare(metadata i8*** %argv.addr, metadata !16, metadata !MDExpression()), !dbg !15 + %0 = load i32, i32* %argc.addr, align 4, !dbg !17 + %1 = load i8**, i8*** %argv.addr, align 8, !dbg !17 call void @test(i32 %0, i8** %1), !dbg !17 ret i32 0, !dbg !19 } @@ -37,24 +37,24 @@ declare void @test(i32, i8**) !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!21} -!0 = !{!"0x11\004\00clang version 3.3 (trunk 173515)\001\00\000\00\000", !20, !2, !2, !3, !2, null} ; [ DW_TAG_compile_unit ] +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 173515)", isOptimized: true, emissionKind: 0, file: !20, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2) !1 = !{!2} !2 = !{i32 0} !3 = !{!5} -!5 = !{!"0x2e\00main\00main\00\003\000\001\000\006\00256\000\004", !20, null, !7, null, i32 (i32, i8**)* @main, null, null, !1} ; [ DW_TAG_subprogram ] -!6 = !{!"0x29", !20} ; [ DW_TAG_file_type ] -!7 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!5 = !MDSubprogram(name: "main", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !20, scope: null, type: !7, function: i32 (i32, i8**)* @main, variables: !1) +!6 = !MDFile(filename: "main.cpp", directory: "/private/tmp") +!7 = !MDSubroutineType(types: !8) !8 = !{!9, !9, !10} -!9 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] -!10 = !{!"0xf\00\000\0064\0064\000\000", null, null, !11} ; [ DW_TAG_pointer_type ] -!11 = !{!"0xf\00\000\0064\0064\000\000", null, null, !12} ; [ DW_TAG_pointer_type ] -!12 = !{!"0x26\00\000\000\000\000\000", null, null, !13} ; [ DW_TAG_const_type ] -!13 = !{!"0x24\00char\000\008\008\000\000\006", null, null} ; [ DW_TAG_base_type ] -!14 = !{!"0x101\00argc\0016777219\000", !5, !6, !9} ; [ DW_TAG_arg_variable ] +!9 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!10 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !11) +!11 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !12) +!12 = !MDDerivedType(tag: DW_TAG_const_type, baseType: !13) +!13 = !MDBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) +!14 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "argc", line: 3, arg: 1, scope: !5, file: !6, type: !9) !15 = !MDLocation(line: 3, scope: !5) -!16 = !{!"0x101\00argv\0033554435\000", !5, !6, !10} ; [ DW_TAG_arg_variable ] +!16 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "argv", line: 3, arg: 2, scope: !5, file: !6, type: !10) !17 = !MDLocation(line: 5, scope: !18) -!18 = !{!"0xb\004\000\000", !20, !5} ; [ DW_TAG_lexical_block ] +!18 = distinct !MDLexicalBlock(line: 4, column: 0, file: !20, scope: !5) !19 = !MDLocation(line: 6, scope: !18) -!20 = !{!"main.cpp", !"/private/tmp"} -!21 = !{i32 1, !"Debug Info Version", i32 2} +!20 = !MDFile(filename: "main.cpp", directory: "/private/tmp") +!21 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Linker/DbgDeclare2.ll b/test/Linker/DbgDeclare2.ll index 2f01b0e..107d8c1 100644 --- a/test/Linker/DbgDeclare2.ll +++ b/test/Linker/DbgDeclare2.ll @@ -11,30 +11,30 @@ entry: %argv.addr = alloca i8**, align 8 %i = alloca i32, align 4 store i32 %argc, i32* %argc.addr, align 4 - call void @llvm.dbg.declare(metadata i32* %argc.addr, metadata !14, metadata !{!"0x102"}), !dbg !15 + call void @llvm.dbg.declare(metadata i32* %argc.addr, metadata !14, metadata !MDExpression()), !dbg !15 store i8** %argv, i8*** %argv.addr, align 8 - call void @llvm.dbg.declare(metadata i8*** %argv.addr, metadata !16, metadata !{!"0x102"}), !dbg !15 - call void @llvm.dbg.declare(metadata i32* %i, metadata !17, metadata !{!"0x102"}), !dbg !20 + call void @llvm.dbg.declare(metadata i8*** %argv.addr, metadata !16, metadata !MDExpression()), !dbg !15 + call void @llvm.dbg.declare(metadata i32* %i, metadata !17, metadata !MDExpression()), !dbg !20 store i32 0, i32* %i, align 4, !dbg !20 br label %for.cond, !dbg !20 for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4, !dbg !20 - %1 = load i32* %argc.addr, align 4, !dbg !20 + %0 = load i32, i32* %i, align 4, !dbg !20 + %1 = load i32, i32* %argc.addr, align 4, !dbg !20 %cmp = icmp slt i32 %0, %1, !dbg !20 br i1 %cmp, label %for.body, label %for.end, !dbg !20 for.body: ; preds = %for.cond - %2 = load i32* %i, align 4, !dbg !21 + %2 = load i32, i32* %i, align 4, !dbg !21 %idxprom = sext i32 %2 to i64, !dbg !21 - %3 = load i8*** %argv.addr, align 8, !dbg !21 - %arrayidx = getelementptr inbounds i8** %3, i64 %idxprom, !dbg !21 - %4 = load i8** %arrayidx, align 8, !dbg !21 + %3 = load i8**, i8*** %argv.addr, align 8, !dbg !21 + %arrayidx = getelementptr inbounds i8*, i8** %3, i64 %idxprom, !dbg !21 + %4 = load i8*, i8** %arrayidx, align 8, !dbg !21 %call = call i32 @puts(i8* %4), !dbg !21 br label %for.inc, !dbg !23 for.inc: ; preds = %for.body - %5 = load i32* %i, align 4, !dbg !20 + %5 = load i32, i32* %i, align 4, !dbg !20 %inc = add nsw i32 %5, 1, !dbg !20 store i32 %inc, i32* %i, align 4, !dbg !20 br label %for.cond, !dbg !20 @@ -50,30 +50,30 @@ declare i32 @puts(i8*) !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!27} -!0 = !{!"0x11\004\00clang version 3.3 (trunk 173515)\001\00\000\00\000", !25, !2, !2, !3, !2, null} ; [ DW_TAG_compile_unit ] +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 173515)", isOptimized: true, emissionKind: 0, file: !25, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2) !1 = !{!2} !2 = !{i32 0} !3 = !{!5} -!5 = !{!"0x2e\00print_args\00print_args\00test\004\000\001\000\006\00256\000\005", !26, null, !7, null, void (i32, i8**)* @test, null, null, !1} ; [ DW_TAG_subprogram ] -!6 = !{!"0x29", !26} ; [ DW_TAG_file_type ] -!7 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!5 = !MDSubprogram(name: "print_args", linkageName: "test", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !26, scope: null, type: !7, function: void (i32, i8**)* @test, variables: !1) +!6 = !MDFile(filename: "test.cpp", directory: "/private/tmp") +!7 = !MDSubroutineType(types: !8) !8 = !{null, !9, !10} -!9 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] -!10 = !{!"0xf\00\000\0064\0064\000\000", null, null, !11} ; [ DW_TAG_pointer_type ] -!11 = !{!"0xf\00\000\0064\0064\000\000", null, null, !12} ; [ DW_TAG_pointer_type ] -!12 = !{!"0x26\00\000\000\000\000\000", null, null, !13} ; [ DW_TAG_const_type ] -!13 = !{!"0x24\00char\000\008\008\000\000\006", null, null} ; [ DW_TAG_base_type ] -!14 = !{!"0x101\00argc\0016777220\000", !5, !6, !9} ; [ DW_TAG_arg_variable ] +!9 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!10 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !11) +!11 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !12) +!12 = !MDDerivedType(tag: DW_TAG_const_type, baseType: !13) +!13 = !MDBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) +!14 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "argc", line: 4, arg: 1, scope: !5, file: !6, type: !9) !15 = !MDLocation(line: 4, scope: !5) -!16 = !{!"0x101\00argv\0033554436\000", !5, !6, !10} ; [ DW_TAG_arg_variable ] -!17 = !{!"0x100\00i\006\000", !18, !6, !9} ; [ DW_TAG_auto_variable ] -!18 = !{!"0xb\006\000\001", !26, !19} ; [ DW_TAG_lexical_block ] -!19 = !{!"0xb\005\000\000", !26, !5} ; [ DW_TAG_lexical_block ] +!16 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "argv", line: 4, arg: 2, scope: !5, file: !6, type: !10) +!17 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "i", line: 6, scope: !18, file: !6, type: !9) +!18 = distinct !MDLexicalBlock(line: 6, column: 0, file: !26, scope: !19) +!19 = distinct !MDLexicalBlock(line: 5, column: 0, file: !26, scope: !5) !20 = !MDLocation(line: 6, scope: !18) !21 = !MDLocation(line: 8, scope: !22) -!22 = !{!"0xb\007\000\002", !26, !18} ; [ DW_TAG_lexical_block ] +!22 = distinct !MDLexicalBlock(line: 7, column: 0, file: !26, scope: !18) !23 = !MDLocation(line: 9, scope: !22) !24 = !MDLocation(line: 10, scope: !19) -!25 = !{!"main.cpp", !"/private/tmp"} -!26 = !{!"test.cpp", !"/private/tmp"} -!27 = !{i32 1, !"Debug Info Version", i32 2} +!25 = !MDFile(filename: "main.cpp", directory: "/private/tmp") +!26 = !MDFile(filename: "test.cpp", directory: "/private/tmp") +!27 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Linker/Inputs/PR11464.b.ll b/test/Linker/Inputs/PR11464.b.ll index 7ef5a36..2c74d9c 100644 --- a/test/Linker/Inputs/PR11464.b.ll +++ b/test/Linker/Inputs/PR11464.b.ll @@ -3,7 +3,7 @@ define i32 @bug_a(%bug_type* %fp) nounwind uwtable { entry: - %d_stream = getelementptr inbounds %bug_type* %fp, i64 0, i32 0 + %d_stream = getelementptr inbounds %bug_type, %bug_type* %fp, i64 0, i32 0 ret i32 0 } diff --git a/test/Linker/Inputs/comdat5.ll b/test/Linker/Inputs/comdat5.ll index 98c42b7..19739eb 100644 --- a/test/Linker/Inputs/comdat5.ll +++ b/test/Linker/Inputs/comdat5.ll @@ -4,6 +4,6 @@ $foo = comdat largest @zed = external constant i8 @some_name = private unnamed_addr constant [2 x i8*] [i8* @zed, i8* bitcast (void ()* @bar to i8*)], comdat($foo) -@foo = alias getelementptr([2 x i8*]* @some_name, i32 0, i32 1) +@foo = alias getelementptr([2 x i8*], [2 x i8*]* @some_name, i32 0, i32 1) declare void @bar() unnamed_addr diff --git a/test/Linker/Inputs/linkage.b.ll b/test/Linker/Inputs/linkage.b.ll index 0ada3f4..9c1d066 100644 --- a/test/Linker/Inputs/linkage.b.ll +++ b/test/Linker/Inputs/linkage.b.ll @@ -3,7 +3,7 @@ declare i32 @foo() define void @bar() { - load i32* @X + load i32, i32* @X call i32 @foo() ret void } diff --git a/test/Linker/Inputs/mdlocation.ll b/test/Linker/Inputs/mdlocation.ll index f85c1dc..6935386 100644 --- a/test/Linker/Inputs/mdlocation.ll +++ b/test/Linker/Inputs/mdlocation.ll @@ -1,10 +1,10 @@ !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9} -!0 = !{} ; Use this as a scope. +!0 = !MDSubprogram() ; Use this as a scope. !1 = !MDLocation(line: 3, column: 7, scope: !0) !2 = !MDLocation(line: 3, column: 7, scope: !0, inlinedAt: !1) !3 = !MDLocation(line: 3, column: 7, scope: !0, inlinedAt: !2) -!4 = distinct !{} ; Test actual remapping. +!4 = distinct !MDSubprogram() ; Test actual remapping. !5 = !MDLocation(line: 3, column: 7, scope: !4) !6 = !MDLocation(line: 3, column: 7, scope: !4, inlinedAt: !5) !7 = !MDLocation(line: 3, column: 7, scope: !4, inlinedAt: !6) diff --git a/test/Linker/Inputs/opaque.ll b/test/Linker/Inputs/opaque.ll index 2b0d7d3..f164abd 100644 --- a/test/Linker/Inputs/opaque.ll +++ b/test/Linker/Inputs/opaque.ll @@ -8,6 +8,6 @@ @g3 = external global %B define void @f1() { - getelementptr %A* null, i32 0 + getelementptr %A, %A* null, i32 0 ret void } diff --git a/test/Linker/Inputs/pr22807-1.ll b/test/Linker/Inputs/pr22807-1.ll new file mode 100644 index 0000000..4081a9b --- /dev/null +++ b/test/Linker/Inputs/pr22807-1.ll @@ -0,0 +1,6 @@ +%struct.A = type { %struct.B* } +%struct.B = type opaque + +define i32 @foo(%struct.A** %A) { + ret i32 0 +} diff --git a/test/Linker/Inputs/pr22807-2.ll b/test/Linker/Inputs/pr22807-2.ll new file mode 100644 index 0000000..7739b77 --- /dev/null +++ b/test/Linker/Inputs/pr22807-2.ll @@ -0,0 +1,6 @@ +%struct.A = type { %struct.B* } +%struct.B = type opaque + +define i32 @bar(%struct.A* %A) { + ret i32 0 +} diff --git a/test/Linker/Inputs/replaced-function-matches-first-subprogram.ll b/test/Linker/Inputs/replaced-function-matches-first-subprogram.ll index a5de89f..f0cf1d3 100644 --- a/test/Linker/Inputs/replaced-function-matches-first-subprogram.ll +++ b/test/Linker/Inputs/replaced-function-matches-first-subprogram.ll @@ -4,7 +4,7 @@ define weak_odr i32 @_ZN5ClassIiE3fooEv(%struct.Class* %this) align 2 { entry: %this.addr = alloca %struct.Class*, align 8 store %struct.Class* %this, %struct.Class** %this.addr, align 8 - %this1 = load %struct.Class** %this.addr + %this1 = load %struct.Class*, %struct.Class** %this.addr ret i32 0, !dbg !12 } @@ -12,16 +12,16 @@ entry: !llvm.module.flags = !{!8, !9, !10} !llvm.ident = !{!11} -!0 = !{!"0x11\004\00clang version 3.6.0 (trunk 224193) (llvm/trunk 224197)\000\00\000\00\002", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d2/t2.cpp] [DW_LANG_C_plus_plus] -!1 = !{!"t2.cpp", !"/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d2"} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 224193) (llvm/trunk 224197)", isOptimized: false, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "t2.cpp", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d2") !2 = !{} !3 = !{!4} -!4 = !{!"0x2e\00foo\00foo\00\002\000\001\000\000\00256\000\002", !5, !6, !7, null, i32 (%struct.Class*)* @_ZN5ClassIiE3fooEv, null, null, !2} ; [ DW_TAG_subprogram ] [line 2] [def] [foo] -!5 = !{!"../t.h", !"/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d2"} -!6 = !{!"0x29", !5} ; [ DW_TAG_file_type ] [/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d2/../t.h] -!7 = !{!"0x15\00\000\000\000\000\000\000", null, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !5, scope: !6, type: !7, function: i32 (%struct.Class*)* @_ZN5ClassIiE3fooEv, variables: !2) +!5 = !MDFile(filename: "../t.h", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d2") +!6 = !MDFile(filename: "../t.h", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d2") +!7 = !MDSubroutineType(types: !2) !8 = !{i32 2, !"Dwarf Version", i32 2} -!9 = !{i32 2, !"Debug Info Version", i32 2} +!9 = !{i32 2, !"Debug Info Version", i32 3} !10 = !{i32 1, !"PIC Level", i32 2} !11 = !{!"clang version 3.6.0 (trunk 224193) (llvm/trunk 224197)"} !12 = !MDLocation(line: 2, column: 15, scope: !4) diff --git a/test/Linker/Inputs/subprogram-linkonce-weak-odr.ll b/test/Linker/Inputs/subprogram-linkonce-weak-odr.ll new file mode 100644 index 0000000..b6518a8 --- /dev/null +++ b/test/Linker/Inputs/subprogram-linkonce-weak-odr.ll @@ -0,0 +1,15 @@ +define weak_odr i32 @foo(i32 %a, i32 %b) { +entry: + %sum = add i32 %a, %b, !dbg !MDLocation(line: 2, scope: !3) + ret i32 %sum, !dbg !MDLocation(line: 3, scope: !3) +} + +!llvm.module.flags = !{!0} +!0 = !{i32 2, !"Debug Info Version", i32 3} + +!llvm.dbg.cu = !{!1} +!1 = !MDCompileUnit(language: DW_LANG_C99, file: !2, subprograms: !{!3}, emissionKind: 1) +!2 = !MDFile(filename: "foo.c", directory: "/path/to/dir") +!3 = !MDSubprogram(file: !4, scope: !4, line: 1, name: "foo", function: i32 (i32, i32)* @foo, type: !5) +!4 = !MDFile(filename: "foo.h", directory: "/path/to/dir") +!5 = !MDSubroutineType(types: !{}) diff --git a/test/Linker/Inputs/subprogram-linkonce-weak.ll b/test/Linker/Inputs/subprogram-linkonce-weak.ll new file mode 100644 index 0000000..e73143d --- /dev/null +++ b/test/Linker/Inputs/subprogram-linkonce-weak.ll @@ -0,0 +1,16 @@ +define weak i32 @foo(i32 %a, i32 %b) { +entry: + %sum = call i32 @fastadd(i32 %a, i32 %b), !dbg !MDLocation(line: 52, scope: !3) + ret i32 %sum, !dbg !MDLocation(line: 53, scope: !3) +} + +declare i32 @fastadd(i32, i32) + +!llvm.module.flags = !{!0} +!0 = !{i32 2, !"Debug Info Version", i32 3} + +!llvm.dbg.cu = !{!1} +!1 = !MDCompileUnit(language: DW_LANG_C99, file: !2, subprograms: !{!3}, emissionKind: 1) +!2 = !MDFile(filename: "foo.c", directory: "/path/to/dir") +!3 = !MDSubprogram(file: !2, scope: !2, line: 51, name: "foo", function: i32 (i32, i32)* @foo, type: !4) +!4 = !MDSubroutineType(types: !{}) diff --git a/test/Linker/Inputs/testlink.ll b/test/Linker/Inputs/testlink.ll index 89f02ba..263d9e7 100644 --- a/test/Linker/Inputs/testlink.ll +++ b/test/Linker/Inputs/testlink.ll @@ -32,9 +32,9 @@ define i32 @foo(i32 %blah) { store i32 %blah, i32* @MyVar - %idx = getelementptr %intlist* @MyIntList, i64 0, i32 1 + %idx = getelementptr %intlist, %intlist* @MyIntList, i64 0, i32 1 store i32 12, i32* %idx - %ack = load i32* @0 + %ack = load i32, i32* @0 %fzo = add i32 %ack, %blah ret i32 %fzo } diff --git a/test/Linker/Inputs/type-unique-inheritance-a.ll b/test/Linker/Inputs/type-unique-inheritance-a.ll index c503919..2159f98 100644 --- a/test/Linker/Inputs/type-unique-inheritance-a.ll +++ b/test/Linker/Inputs/type-unique-inheritance-a.ll @@ -1,7 +1,7 @@ -; CHECK: [ DW_TAG_class_type ] [A] -; CHECK: [ DW_TAG_class_type ] [Base] -; CHECK: [ DW_TAG_class_type ] [B] -; CHECK-NOT: DW_TAG_class_type +; CHECK: !MDCompositeType(tag: DW_TAG_class_type, name: "A" +; CHECK: !MDCompositeType(tag: DW_TAG_class_type, name: "Base" +; CHECK: !MDCompositeType(tag: DW_TAG_class_type, name: "B" +; CHECK-NOT: !MDCompositeType(tag: DW_TAG_class_type ; Content of header files: ; ; class Base; @@ -52,8 +52,8 @@ entry: %a.addr = alloca i32, align 4 %t = alloca %class.A, align 4 store i32 %a, i32* %a.addr, align 4 - call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !20, metadata !{!"0x102"}), !dbg !21 - call void @llvm.dbg.declare(metadata %class.A* %t, metadata !22, metadata !{!"0x102"}), !dbg !23 + call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !20, metadata !MDExpression()), !dbg !21 + call void @llvm.dbg.declare(metadata %class.A* %t, metadata !22, metadata !MDExpression()), !dbg !23 ret void, !dbg !24 } @@ -66,29 +66,29 @@ attributes #1 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!19, !25} -!0 = !{!"0x11\004\00clang version 3.4 (http://llvm.org/git/clang.git f54e02f969d02d640103db73efc30c45439fceab) (http://llvm.org/git/llvm.git 284353b55896cb1babfaa7add7c0a363245342d2)\000\00\000\00\000", !1, !2, !3, !14, !2, !2} ; [ DW_TAG_compile_unit ] [/Users/mren/c_testing/type_unique_air/inher/foo.cpp] [DW_LANG_C_plus_plus] -!1 = !{!"foo.cpp", !"/Users/mren/c_testing/type_unique_air/inher"} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (http://llvm.org/git/clang.git f54e02f969d02d640103db73efc30c45439fceab) (http://llvm.org/git/llvm.git 284353b55896cb1babfaa7add7c0a363245342d2)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !14, globals: !2, imports: !2) +!1 = !MDFile(filename: "foo.cpp", directory: "/Users/mren/c_testing/type_unique_air/inher") !2 = !{i32 0} !3 = !{!4, !8} -!4 = !{!"0x2\00A\003\0064\0032\000\000\000", !5, null, null, !6, null, null, !"_ZTS1A"} ; [ DW_TAG_class_type ] [A] [line 3, size 64, align 32, offset 0] [def] [from ] -!5 = !{!"./a.hpp", !"/Users/mren/c_testing/type_unique_air/inher"} +!4 = !MDCompositeType(tag: DW_TAG_class_type, name: "A", line: 3, size: 64, align: 32, file: !5, elements: !6, identifier: "_ZTS1A") +!5 = !MDFile(filename: "./a.hpp", directory: "/Users/mren/c_testing/type_unique_air/inher") !6 = !{!7, !13} -!7 = !{!"0x1c\00\000\000\000\000\001", null, !"_ZTS1A", !8} ; [ DW_TAG_inheritance ] [line 0, size 0, align 0, offset 0] [private] [from Base] -!8 = !{!"0x2\00Base\003\0032\0032\000\000\000", !9, null, null, !10, null, null, !"_ZTS4Base"} ; [ DW_TAG_class_type ] [Base] [line 3, size 32, align 32, offset 0] [def] [from ] -!9 = !{!"./b.hpp", !"/Users/mren/c_testing/type_unique_air/inher"} +!7 = !MDDerivedType(tag: DW_TAG_inheritance, flags: DIFlagPrivate, scope: !"_ZTS1A", baseType: !8) +!8 = !MDCompositeType(tag: DW_TAG_class_type, name: "Base", line: 3, size: 32, align: 32, file: !9, elements: !10, identifier: "_ZTS4Base") +!9 = !MDFile(filename: "./b.hpp", directory: "/Users/mren/c_testing/type_unique_air/inher") !10 = !{!11} -!11 = !{!"0xd\00b\004\0032\0032\000\001", !9, !"_ZTS4Base", !12} ; [ DW_TAG_member ] [b] [line 4, size 32, align 32, offset 0] [private] [from int] -!12 = !{!"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] -!13 = !{!"0xd\00x\004\0032\0032\0032\001", !5, !"_ZTS1A", !12} ; [ DW_TAG_member ] [x] [line 4, size 32, align 32, offset 32] [private] [from int] +!11 = !MDDerivedType(tag: DW_TAG_member, name: "b", line: 4, size: 32, align: 32, flags: DIFlagPrivate, file: !9, scope: !"_ZTS4Base", baseType: !12) +!12 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!13 = !MDDerivedType(tag: DW_TAG_member, name: "x", line: 4, size: 32, align: 32, offset: 32, flags: DIFlagPrivate, file: !5, scope: !"_ZTS1A", baseType: !12) !14 = !{!15} -!15 = !{!"0x2e\00f\00f\00_Z1fi\005\000\001\000\006\00256\000\005", !1, !16, !17, null, void (i32)* @_Z1fi, null, null, !2} ; [ DW_TAG_subprogram ] [line 5] [def] [f] -!16 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/Users/mren/c_testing/type_unique_air/inher/foo.cpp] -!17 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !18, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!15 = !MDSubprogram(name: "f", linkageName: "_Z1fi", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !16, type: !17, function: void (i32)* @_Z1fi, variables: !2) +!16 = !MDFile(filename: "foo.cpp", directory: "/Users/mren/c_testing/type_unique_air/inher") +!17 = !MDSubroutineType(types: !18) !18 = !{null, !12} !19 = !{i32 2, !"Dwarf Version", i32 2} -!20 = !{!"0x101\00a\0016777221\000", !15, !16, !12} ; [ DW_TAG_arg_variable ] [a] [line 5] +!20 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 5, arg: 1, scope: !15, file: !16, type: !12) !21 = !MDLocation(line: 5, scope: !15) -!22 = !{!"0x100\00t\006\000", !15, !16, !4} ; [ DW_TAG_auto_variable ] [t] [line 6] +!22 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "t", line: 6, scope: !15, file: !16, type: !4) !23 = !MDLocation(line: 6, scope: !15) !24 = !MDLocation(line: 7, scope: !15) -!25 = !{i32 1, !"Debug Info Version", i32 2} +!25 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Linker/Inputs/type-unique-inheritance-b.ll b/test/Linker/Inputs/type-unique-inheritance-b.ll index d3b9dea..f16ae1a 100644 --- a/test/Linker/Inputs/type-unique-inheritance-b.ll +++ b/test/Linker/Inputs/type-unique-inheritance-b.ll @@ -10,8 +10,8 @@ entry: %a.addr = alloca i32, align 4 %t = alloca %class.B, align 8 store i32 %a, i32* %a.addr, align 4 - call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !28, metadata !{!"0x102"}), !dbg !29 - call void @llvm.dbg.declare(metadata %class.B* %t, metadata !30, metadata !{!"0x102"}), !dbg !31 + call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !28, metadata !MDExpression()), !dbg !29 + call void @llvm.dbg.declare(metadata %class.B* %t, metadata !30, metadata !MDExpression()), !dbg !31 ret void, !dbg !32 } @@ -24,7 +24,7 @@ entry: %retval = alloca i32, align 4 %a = alloca %class.A, align 4 store i32 0, i32* %retval - call void @llvm.dbg.declare(metadata %class.A* %a, metadata !33, metadata !{!"0x102"}), !dbg !34 + call void @llvm.dbg.declare(metadata %class.A* %a, metadata !33, metadata !MDExpression()), !dbg !34 call void @_Z1fi(i32 0), !dbg !35 call void @_Z1gi(i32 1), !dbg !36 ret i32 0, !dbg !37 @@ -40,42 +40,42 @@ attributes #3 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!27, !38} -!0 = !{!"0x11\004\00clang version 3.4 (http://llvm.org/git/clang.git f54e02f969d02d640103db73efc30c45439fceab) (http://llvm.org/git/llvm.git 284353b55896cb1babfaa7add7c0a363245342d2)\000\00\000\00\000", !1, !2, !3, !19, !2, !2} ; [ DW_TAG_compile_unit ] [/Users/mren/c_testing/type_unique_air/inher/bar.cpp] [DW_LANG_C_plus_plus] -!1 = !{!"bar.cpp", !"/Users/mren/c_testing/type_unique_air/inher"} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (http://llvm.org/git/clang.git f54e02f969d02d640103db73efc30c45439fceab) (http://llvm.org/git/llvm.git 284353b55896cb1babfaa7add7c0a363245342d2)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !19, globals: !2, imports: !2) +!1 = !MDFile(filename: "bar.cpp", directory: "/Users/mren/c_testing/type_unique_air/inher") !2 = !{i32 0} !3 = !{!4, !11, !15} -!4 = !{!"0x2\00B\007\00128\0064\000\000\000", !5, null, null, !6, null, null, !"_ZTS1B"} ; [ DW_TAG_class_type ] [B] [line 7, size 128, align 64, offset 0] [def] [from ] -!5 = !{!"./b.hpp", !"/Users/mren/c_testing/type_unique_air/inher"} +!4 = !MDCompositeType(tag: DW_TAG_class_type, name: "B", line: 7, size: 128, align: 64, file: !5, elements: !6, identifier: "_ZTS1B") +!5 = !MDFile(filename: "./b.hpp", directory: "/Users/mren/c_testing/type_unique_air/inher") !6 = !{!7, !9} -!7 = !{!"0xd\00bb\008\0032\0032\000\001", !5, !"_ZTS1B", !8} ; [ DW_TAG_member ] [bb] [line 8, size 32, align 32, offset 0] [private] [from int] -!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] -!9 = !{!"0xd\00a\009\0064\0064\0064\001", !5, !"_ZTS1B", !10} ; [ DW_TAG_member ] [a] [line 9, size 64, align 64, offset 64] [private] [from ] -!10 = !{!"0xf\00\000\0064\0064\000\000", null, null, !11} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from A] -!11 = !{!"0x2\00A\003\0064\0032\000\000\000", !12, null, null, !13, null, null, !"_ZTS1A"} ; [ DW_TAG_class_type ] [A] [line 3, size 64, align 32, offset 0] [def] [from ] -!12 = !{!"./a.hpp", !"/Users/mren/c_testing/type_unique_air/inher"} +!7 = !MDDerivedType(tag: DW_TAG_member, name: "bb", line: 8, size: 32, align: 32, flags: DIFlagPrivate, file: !5, scope: !"_ZTS1B", baseType: !8) +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !MDDerivedType(tag: DW_TAG_member, name: "a", line: 9, size: 64, align: 64, offset: 64, flags: DIFlagPrivate, file: !5, scope: !"_ZTS1B", baseType: !10) +!10 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !11) +!11 = !MDCompositeType(tag: DW_TAG_class_type, name: "A", line: 3, size: 64, align: 32, file: !12, elements: !13, identifier: "_ZTS1A") +!12 = !MDFile(filename: "./a.hpp", directory: "/Users/mren/c_testing/type_unique_air/inher") !13 = !{!14, !18} -!14 = !{!"0x1c\00\000\000\000\000\001", null, !"_ZTS1A", !15} ; [ DW_TAG_inheritance ] [line 0, size 0, align 0, offset 0] [private] [from Base] -!15 = !{!"0x2\00Base\003\0032\0032\000\000\000", !5, null, null, !16, null, null, !"_ZTS4Base"} ; [ DW_TAG_class_type ] [Base] [line 3, size 32, align 32, offset 0] [def] [from ] +!14 = !MDDerivedType(tag: DW_TAG_inheritance, flags: DIFlagPrivate, scope: !"_ZTS1A", baseType: !15) +!15 = !MDCompositeType(tag: DW_TAG_class_type, name: "Base", line: 3, size: 32, align: 32, file: !5, elements: !16, identifier: "_ZTS4Base") !16 = !{!17} -!17 = !{!"0xd\00b\004\0032\0032\000\001", !5, !"_ZTS4Base", !8} ; [ DW_TAG_member ] [b] [line 4, size 32, align 32, offset 0] [private] [from int] -!18 = !{!"0xd\00x\004\0032\0032\0032\001", !12, !"_ZTS1A", !8} ; [ DW_TAG_member ] [x] [line 4, size 32, align 32, offset 32] [private] [from int] +!17 = !MDDerivedType(tag: DW_TAG_member, name: "b", line: 4, size: 32, align: 32, flags: DIFlagPrivate, file: !5, scope: !"_ZTS4Base", baseType: !8) +!18 = !MDDerivedType(tag: DW_TAG_member, name: "x", line: 4, size: 32, align: 32, offset: 32, flags: DIFlagPrivate, file: !12, scope: !"_ZTS1A", baseType: !8) !19 = !{!20, !24} -!20 = !{!"0x2e\00g\00g\00_Z1gi\004\000\001\000\006\00256\000\004", !1, !21, !22, null, void (i32)* @_Z1gi, null, null, !2} ; [ DW_TAG_subprogram ] [line 4] [def] [g] -!21 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/Users/mren/c_testing/type_unique_air/inher/bar.cpp] -!22 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !23, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!20 = !MDSubprogram(name: "g", linkageName: "_Z1gi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !21, type: !22, function: void (i32)* @_Z1gi, variables: !2) +!21 = !MDFile(filename: "bar.cpp", directory: "/Users/mren/c_testing/type_unique_air/inher") +!22 = !MDSubroutineType(types: !23) !23 = !{null, !8} -!24 = !{!"0x2e\00main\00main\00\009\000\001\000\006\00256\000\009", !1, !21, !25, null, i32 ()* @main, null, null, !2} ; [ DW_TAG_subprogram ] [line 9] [def] [main] -!25 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !26, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!24 = !MDSubprogram(name: "main", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 9, file: !1, scope: !21, type: !25, function: i32 ()* @main, variables: !2) +!25 = !MDSubroutineType(types: !26) !26 = !{!8} !27 = !{i32 2, !"Dwarf Version", i32 2} -!28 = !{!"0x101\00a\0016777220\000", !20, !21, !8} ; [ DW_TAG_arg_variable ] [a] [line 4] +!28 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 4, arg: 1, scope: !20, file: !21, type: !8) !29 = !MDLocation(line: 4, scope: !20) -!30 = !{!"0x100\00t\005\000", !20, !21, !4} ; [ DW_TAG_auto_variable ] [t] [line 5] +!30 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "t", line: 5, scope: !20, file: !21, type: !4) !31 = !MDLocation(line: 5, scope: !20) !32 = !MDLocation(line: 6, scope: !20) -!33 = !{!"0x100\00a\0010\000", !24, !21, !11} ; [ DW_TAG_auto_variable ] [a] [line 10] +!33 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 10, scope: !24, file: !21, type: !11) !34 = !MDLocation(line: 10, scope: !24) !35 = !MDLocation(line: 11, scope: !24) !36 = !MDLocation(line: 12, scope: !24) !37 = !MDLocation(line: 13, scope: !24) -!38 = !{i32 1, !"Debug Info Version", i32 2} +!38 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Linker/Inputs/type-unique-simple2-a.ll b/test/Linker/Inputs/type-unique-simple2-a.ll index 6d6e93c..3a5695e 100644 --- a/test/Linker/Inputs/type-unique-simple2-a.ll +++ b/test/Linker/Inputs/type-unique-simple2-a.ll @@ -49,8 +49,8 @@ entry: %a.addr = alloca i32, align 4 %t = alloca %struct.Base, align 8 store i32 %a, i32* %a.addr, align 4 - call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !17, metadata !{!"0x102"}), !dbg !18 - call void @llvm.dbg.declare(metadata %struct.Base* %t, metadata !19, metadata !{!"0x102"}), !dbg !20 + call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !17, metadata !MDExpression()), !dbg !18 + call void @llvm.dbg.declare(metadata %struct.Base* %t, metadata !19, metadata !MDExpression()), !dbg !20 ret void, !dbg !21 } @@ -63,26 +63,26 @@ attributes #1 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!16, !22} -!0 = !{!"0x11\004\00clang version 3.4 (http://llvm.org/git/clang.git 8a3f9e46cb988d2c664395b21910091e3730ae82) (http://llvm.org/git/llvm.git 4699e9549358bc77824a59114548eecc3f7c523c)\000\00\000\00\000", !1, !2, !3, !11, !2, !2} ; [ DW_TAG_compile_unit ] [foo.cpp] [DW_LANG_C_plus_plus] -!1 = !{!"foo.cpp", !"."} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (http://llvm.org/git/clang.git 8a3f9e46cb988d2c664395b21910091e3730ae82) (http://llvm.org/git/llvm.git 4699e9549358bc77824a59114548eecc3f7c523c)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !11, globals: !2, imports: !2) +!1 = !MDFile(filename: "foo.cpp", directory: ".") !2 = !{} !3 = !{!4} -!4 = !{!"0x13\00Base\001\00128\0064\000\000\000", !5, null, null, !6, null, null, !"_ZTS4Base"} ; [ DW_TAG_structure_type ] [Base] [line 1, size 128, align 64, offset 0] [def] [from ] -!5 = !{!"./a.hpp", !"."} +!4 = !MDCompositeType(tag: DW_TAG_structure_type, name: "Base", line: 1, size: 128, align: 64, file: !5, elements: !6, identifier: "_ZTS4Base") +!5 = !MDFile(filename: "./a.hpp", directory: ".") !6 = !{!7, !9} -!7 = !{!"0xd\00a\002\0032\0032\000\000", !5, !"_ZTS4Base", !8} ; [ DW_TAG_member ] [a] [line 2, size 32, align 32, offset 0] [from int] -!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] -!9 = !{!"0xd\00b\003\0064\0064\0064\000", !5, !"_ZTS4Base", !10} ; [ DW_TAG_member ] [b] [line 3, size 64, align 64, offset 64] [from ] -!10 = !{!"0xf\00\000\0064\0064\000\000", null, null, !"_ZTS4Base"} ; [ DW_TAG_pointer_type ] +!7 = !MDDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, file: !5, scope: !"_ZTS4Base", baseType: !8) +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !MDDerivedType(tag: DW_TAG_member, name: "b", line: 3, size: 64, align: 64, offset: 64, file: !5, scope: !"_ZTS4Base", baseType: !10) +!10 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS4Base") !11 = !{!12} -!12 = !{!"0x2e\00f\00f\00_Z1fi\003\000\001\000\006\00256\000\003", !1, !13, !14, null, void (i32)* @_Z1fi, null, null, !2} ; [ DW_TAG_subprogram ] [line 3] [def] [f] -!13 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [foo.cpp] -!14 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !15, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!12 = !MDSubprogram(name: "f", linkageName: "_Z1fi", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !13, type: !14, function: void (i32)* @_Z1fi, variables: !2) +!13 = !MDFile(filename: "foo.cpp", directory: ".") +!14 = !MDSubroutineType(types: !15) !15 = !{null, !8} !16 = !{i32 2, !"Dwarf Version", i32 2} -!17 = !{!"0x101\00a\0016777219\000", !12, !13, !8} ; [ DW_TAG_arg_variable ] [a] [line 3] +!17 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 3, arg: 1, scope: !12, file: !13, type: !8) !18 = !MDLocation(line: 3, scope: !12) -!19 = !{!"0x100\00t\004\000", !12, !13, !4} ; [ DW_TAG_auto_variable ] [t] [line 4] +!19 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "t", line: 4, scope: !12, file: !13, type: !4) !20 = !MDLocation(line: 4, scope: !12) !21 = !MDLocation(line: 5, scope: !12) -!22 = !{i32 1, !"Debug Info Version", i32 2} +!22 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Linker/Inputs/type-unique-simple2-b.ll b/test/Linker/Inputs/type-unique-simple2-b.ll index d3b2f7e..0c1faca 100644 --- a/test/Linker/Inputs/type-unique-simple2-b.ll +++ b/test/Linker/Inputs/type-unique-simple2-b.ll @@ -8,8 +8,8 @@ entry: %a.addr = alloca i32, align 4 %t = alloca %struct.Base, align 8 store i32 %a, i32* %a.addr, align 4 - call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !20, metadata !{!"0x102"}), !dbg !21 - call void @llvm.dbg.declare(metadata %struct.Base* %t, metadata !22, metadata !{!"0x102"}), !dbg !23 + call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !20, metadata !MDExpression()), !dbg !21 + call void @llvm.dbg.declare(metadata %struct.Base* %t, metadata !22, metadata !MDExpression()), !dbg !23 ret void, !dbg !24 } @@ -36,32 +36,32 @@ attributes #3 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!19, !28} -!0 = !{!"0x11\004\00clang version 3.4 (http://llvm.org/git/clang.git 8a3f9e46cb988d2c664395b21910091e3730ae82) (http://llvm.org/git/llvm.git 4699e9549358bc77824a59114548eecc3f7c523c)\000\00\000\00\000", !1, !2, !3, !11, !2, !2} ; [ DW_TAG_compile_unit ] [bar.cpp] [DW_LANG_C_plus_plus] -!1 = !{!"bar.cpp", !"."} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (http://llvm.org/git/clang.git 8a3f9e46cb988d2c664395b21910091e3730ae82) (http://llvm.org/git/llvm.git 4699e9549358bc77824a59114548eecc3f7c523c)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !11, globals: !2, imports: !2) +!1 = !MDFile(filename: "bar.cpp", directory: ".") !2 = !{} !3 = !{!4} -!4 = !{!"0x13\00Base\001\00128\0064\000\000\000", !5, null, null, !6, null, null, !"_ZTS4Base"} ; [ DW_TAG_structure_type ] [Base] [line 1, size 128, align 64, offset 0] [def] [from ] -!5 = !{!"./a.hpp", !"."} +!4 = !MDCompositeType(tag: DW_TAG_structure_type, name: "Base", line: 1, size: 128, align: 64, file: !5, elements: !6, identifier: "_ZTS4Base") +!5 = !MDFile(filename: "./a.hpp", directory: ".") !6 = !{!7, !9} -!7 = !{!"0xd\00a\002\0032\0032\000\000", !5, !"_ZTS4Base", !8} ; [ DW_TAG_member ] [a] [line 2, size 32, align 32, offset 0] [from int] -!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] -!9 = !{!"0xd\00b\003\0064\0064\0064\000", !5, !"_ZTS4Base", !10} ; [ DW_TAG_member ] [b] [line 3, size 64, align 64, offset 64] [from ] -!10 = !{!"0xf\00\000\0064\0064\000\000", null, null, !"_ZTS4Base"} ; [ DW_TAG_pointer_type ] +!7 = !MDDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, file: !5, scope: !"_ZTS4Base", baseType: !8) +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !MDDerivedType(tag: DW_TAG_member, name: "b", line: 3, size: 64, align: 64, offset: 64, file: !5, scope: !"_ZTS4Base", baseType: !10) +!10 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS4Base") !11 = !{!12, !16} -!12 = !{!"0x2e\00g\00g\00_Z1gi\004\000\001\000\006\00256\000\004", !1, !13, !14, null, void (i32)* @_Z1gi, null, null, !2} ; [ DW_TAG_subprogram ] [line 4] [def] [g] -!13 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [bar.cpp] -!14 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !15, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!12 = !MDSubprogram(name: "g", linkageName: "_Z1gi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !13, type: !14, function: void (i32)* @_Z1gi, variables: !2) +!13 = !MDFile(filename: "bar.cpp", directory: ".") +!14 = !MDSubroutineType(types: !15) !15 = !{null, !8} -!16 = !{!"0x2e\00main\00main\00\007\000\001\000\006\00256\000\007", !1, !13, !17, null, i32 ()* @main, null, null, !2} ; [ DW_TAG_subprogram ] [line 7] [def] [main] -!17 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !18, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!16 = !MDSubprogram(name: "main", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !13, type: !17, function: i32 ()* @main, variables: !2) +!17 = !MDSubroutineType(types: !18) !18 = !{!8} !19 = !{i32 2, !"Dwarf Version", i32 2} -!20 = !{!"0x101\00a\0016777220\000", !12, !13, !8} ; [ DW_TAG_arg_variable ] [a] [line 4] +!20 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 4, arg: 1, scope: !12, file: !13, type: !8) !21 = !MDLocation(line: 4, scope: !12) -!22 = !{!"0x100\00t\005\000", !12, !13, !4} ; [ DW_TAG_auto_variable ] [t] [line 5] +!22 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "t", line: 5, scope: !12, file: !13, type: !4) !23 = !MDLocation(line: 5, scope: !12) !24 = !MDLocation(line: 6, scope: !12) !25 = !MDLocation(line: 8, scope: !16) !26 = !MDLocation(line: 9, scope: !16) !27 = !MDLocation(line: 10, scope: !16) -!28 = !{i32 1, !"Debug Info Version", i32 2} +!28 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Linker/broken.ll b/test/Linker/broken.ll new file mode 100644 index 0000000..2276401 --- /dev/null +++ b/test/Linker/broken.ll @@ -0,0 +1,8 @@ +; RUN: not llvm-link -o /dev/null %s 2>&1 | FileCheck %s + +; CHECK: input module '{{.*}}broken.ll' is broken +define i32 @foo(i32 %v) { + %first = add i32 %v, %second + %second = add i32 %v, 3 + ret i32 %first +} diff --git a/test/Linker/comdat3.ll b/test/Linker/comdat3.ll deleted file mode 100644 index 3b5db0a..0000000 --- a/test/Linker/comdat3.ll +++ /dev/null @@ -1,5 +0,0 @@ -; RUN: not llvm-link %s %p/Inputs/comdat2.ll -S -o - 2>&1 | FileCheck %s - -$foo = comdat largest -@foo = global i32 43, comdat($foo) -; CHECK: Linking COMDATs named 'foo': can't do size dependent selection without DataLayout! diff --git a/test/Linker/comdat6.ll b/test/Linker/comdat6.ll index b5360a7..15be2fe 100644 --- a/test/Linker/comdat6.ll +++ b/test/Linker/comdat6.ll @@ -5,6 +5,6 @@ target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32" $foo = comdat largest @foo = linkonce_odr unnamed_addr constant [1 x i8*] [i8* bitcast (void ()* @bar to i8*)], comdat($foo) -; CHECK: @foo = alias getelementptr inbounds ([2 x i8*]* @some_name, i32 0, i32 1) +; CHECK: @foo = alias getelementptr inbounds ([2 x i8*], [2 x i8*]* @some_name, i32 0, i32 1) declare void @bar() unnamed_addr diff --git a/test/Linker/datalayout.ll b/test/Linker/datalayout.ll index 8cbfc19..cba2877 100644 --- a/test/Linker/datalayout.ll +++ b/test/Linker/datalayout.ll @@ -1,13 +1,12 @@ ; REQUIRES: shell -; RUN: llvm-link %s %S/Inputs/datalayout-a.ll -S -o - 2>%t.a.err | FileCheck %s +; RUN: llvm-link %s %S/Inputs/datalayout-a.ll -S -o - 2>%t.a.err ; RUN: (echo foo ;cat %t.a.err) | FileCheck --check-prefix=WARN-A %s -; RUN: llvm-link %s %S/Inputs/datalayout-b.ll -S -o - 2>%t.b.err | FileCheck %s +; RUN: llvm-link %s %S/Inputs/datalayout-b.ll -S -o - 2>%t.b.err ; RUN: cat %t.b.err | FileCheck --check-prefix=WARN-B %s target datalayout = "e" -; CHECK: target datalayout = "e" ; WARN-A-NOT: WARNING diff --git a/test/Linker/debug-info-version-a.ll b/test/Linker/debug-info-version-a.ll index 352fcdc..7d73e86 100644 --- a/test/Linker/debug-info-version-a.ll +++ b/test/Linker/debug-info-version-a.ll @@ -3,14 +3,14 @@ ; Test linking of incompatible debug info versions. The debug info ; from the other file should be dropped. -; CHECK-NOT: metadata !{metadata !"b.c", metadata !""} -; CHECK: !"a.c", !""} -; CHECK-NOT: metadata !{metadata !"b.c", metadata !""} +; CHECK-NOT: !MDFile(filename: "b.c", directory: "") +; CHECK: !MDFile(filename: "a.c", directory: "") +; CHECK-NOT: !MDFile(filename: "b.c", directory: "") !llvm.module.flags = !{ !0 } !llvm.dbg.cu = !{!1} -!0 = !{i32 2, !"Debug Info Version", i32 2} -!1 = !{!"0x11\0012\00clang\001\00\000\00\000", !2, !3, !3, !3, null, null} ; [ DW_TAG_compile_unit ] -!2 = !{!"a.c", !""} +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang", isOptimized: true, emissionKind: 0, file: !2, enums: !3, retainedTypes: !3, subprograms: !3) +!2 = !MDFile(filename: "a.c", directory: "") !3 = !{} diff --git a/test/Linker/debug-info-version-b.ll b/test/Linker/debug-info-version-b.ll index e494420..cc1c625 100644 --- a/test/Linker/debug-info-version-b.ll +++ b/test/Linker/debug-info-version-b.ll @@ -5,6 +5,6 @@ !llvm.dbg.cu = !{!1} !0 = !{i32 2, !"Debug Info Version", i32 42} -!1 = !{!"0x11\0012\00clang\000\00", !"I AM UNEXPECTED!"} ; [ DW_TAG_compile_unit ] +!1 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang", isOptimized: false, file: !"I AM UNEXPECTED!") !2 = !{!"b.c", !""} !3 = !{} diff --git a/test/Linker/link-global-to-func.ll b/test/Linker/link-global-to-func.ll index 4d83fe5..f7adde9 100644 --- a/test/Linker/link-global-to-func.ll +++ b/test/Linker/link-global-to-func.ll @@ -9,6 +9,6 @@ @__eprintf = external global i8* ; <i8**> [#uses=1] define i8* @test() { - %A = load i8** @__eprintf ; <i8*> [#uses=1] + %A = load i8*, i8** @__eprintf ; <i8*> [#uses=1] ret i8* %A } diff --git a/test/Linker/mdlocation.ll b/test/Linker/mdlocation.ll index 5ee366c..9aea4b9 100644 --- a/test/Linker/mdlocation.ll +++ b/test/Linker/mdlocation.ll @@ -5,27 +5,27 @@ ; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !0, !1, !2, !3, !10, !11, !12, !13, !14, !15} !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9} -; CHECK: !0 = !{} +; CHECK: !0 = !MDSubprogram( ; CHECK-NEXT: !1 = !MDLocation(line: 3, column: 7, scope: !0) ; CHECK-NEXT: !2 = !MDLocation(line: 3, column: 7, scope: !0, inlinedAt: !1) ; CHECK-NEXT: !3 = !MDLocation(line: 3, column: 7, scope: !0, inlinedAt: !2) -; CHECK-NEXT: !4 = distinct !{} +; CHECK-NEXT: !4 = distinct !MDSubprogram( ; CHECK-NEXT: !5 = !MDLocation(line: 3, column: 7, scope: !4) ; CHECK-NEXT: !6 = !MDLocation(line: 3, column: 7, scope: !4, inlinedAt: !5) ; CHECK-NEXT: !7 = !MDLocation(line: 3, column: 7, scope: !4, inlinedAt: !6) ; CHECK-NEXT: !8 = distinct !MDLocation(line: 3, column: 7, scope: !0) ; CHECK-NEXT: !9 = distinct !MDLocation(line: 3, column: 7, scope: !0, inlinedAt: !8) -; CHECK-NEXT: !10 = distinct !{} +; CHECK-NEXT: !10 = distinct !MDSubprogram( ; CHECK-NEXT: !11 = !MDLocation(line: 3, column: 7, scope: !10) ; CHECK-NEXT: !12 = !MDLocation(line: 3, column: 7, scope: !10, inlinedAt: !11) ; CHECK-NEXT: !13 = !MDLocation(line: 3, column: 7, scope: !10, inlinedAt: !12) ; CHECK-NEXT: !14 = distinct !MDLocation(line: 3, column: 7, scope: !0) ; CHECK-NEXT: !15 = distinct !MDLocation(line: 3, column: 7, scope: !0, inlinedAt: !14) -!0 = !{} ; Use this as a scope. +!0 = !MDSubprogram() ; Use this as a scope. !1 = !MDLocation(line: 3, column: 7, scope: !0) !2 = !MDLocation(line: 3, column: 7, scope: !0, inlinedAt: !1) !3 = !MDLocation(line: 3, column: 7, scope: !0, inlinedAt: !2) -!4 = distinct !{} ; Test actual remapping. +!4 = distinct !MDSubprogram() ; Test actual remapping. !5 = !MDLocation(line: 3, column: 7, scope: !4) !6 = !MDLocation(line: 3, column: 7, scope: !4, inlinedAt: !5) !7 = !MDLocation(line: 3, column: 7, scope: !4, inlinedAt: !6) diff --git a/test/Linker/module-flags-3-b.ll b/test/Linker/module-flags-3-b.ll index 2e6e529..a983db2 100644 --- a/test/Linker/module-flags-3-b.ll +++ b/test/Linker/module-flags-3-b.ll @@ -2,5 +2,6 @@ ; RUN: true !0 = !{i32 3, !"foo", !{!"bar", i32 42}} +!1 = !{i32 1, !"bar", i32 42} -!llvm.module.flags = !{ !0 } +!llvm.module.flags = !{ !0, !1 } diff --git a/test/Linker/module-flags-4-b.ll b/test/Linker/module-flags-4-b.ll index 25aaf19..02d2603 100644 --- a/test/Linker/module-flags-4-b.ll +++ b/test/Linker/module-flags-4-b.ll @@ -2,5 +2,6 @@ ; RUN: true !0 = !{i32 3, !"foo", !{!"bar", i32 42}} +!1 = !{i32 2, !"bar", i32 42} -!llvm.module.flags = !{ !0 } +!llvm.module.flags = !{ !0, !1 } diff --git a/test/Linker/opaque.ll b/test/Linker/opaque.ll index 1ba878c..4f3f398 100644 --- a/test/Linker/opaque.ll +++ b/test/Linker/opaque.ll @@ -11,7 +11,7 @@ ; CHECK-DAG: @g2 = external global %A ; CHECK-DAG: @g3 = external global %B.1 -; CHECK-DAG: getelementptr %A* null, i32 0 +; CHECK-DAG: getelementptr %A, %A* null, i32 0 %A = type opaque %B = type { %C, %C, %B* } diff --git a/test/Linker/partial-type-refinement-link.ll b/test/Linker/partial-type-refinement-link.ll index 320ef96..0c92111 100644 --- a/test/Linker/partial-type-refinement-link.ll +++ b/test/Linker/partial-type-refinement-link.ll @@ -15,6 +15,6 @@ define void @f(%"SmallVImpl<const PI*>"* %this) { entry: - %x = getelementptr inbounds %"SmallVImpl<const PI*>"* %this, i64 0, i32 1 + %x = getelementptr inbounds %"SmallVImpl<const PI*>", %"SmallVImpl<const PI*>"* %this, i64 0, i32 1 ret void } diff --git a/test/Linker/partial-type-refinement.ll b/test/Linker/partial-type-refinement.ll index b995f11..e9a645b 100644 --- a/test/Linker/partial-type-refinement.ll +++ b/test/Linker/partial-type-refinement.ll @@ -1,7 +1,7 @@ ; RUN: llvm-link %s %p/partial-type-refinement-link.ll -S | FileCheck %s ; PR4954 -; CHECK: load %PI** getelementptr inbounds (%"RegisterP<LowerArrayLength>"* @_ZN3mvmL1XE, i64 0, i32 0, i32 6, i32 0, i32 0, i32 0), align 16 +; CHECK: load %PI*, %PI** getelementptr inbounds (%"RegisterP<LowerArrayLength>", %"RegisterP<LowerArrayLength>"* @_ZN3mvmL1XE, i64 0, i32 0, i32 6, i32 0, i32 0, i32 0), align 16 %AnalysisResolver = type { i8, %PMDataManager* } %"DenseMap<P*,AU*>" = type { i64, %"pair<P*,AU*>"*, i64, i64 } @@ -19,6 +19,6 @@ define void @__tcf_0() nounwind { entry: - %0 = load %PI** getelementptr inbounds (%"RegisterP<LowerArrayLength>"* @_ZN3mvmL1XE, i64 0, i32 0, i32 6, i32 0, i32 0, i32 0), align 16 + %0 = load %PI*, %PI** getelementptr inbounds (%"RegisterP<LowerArrayLength>", %"RegisterP<LowerArrayLength>"* @_ZN3mvmL1XE, i64 0, i32 0, i32 6, i32 0, i32 0, i32 0), align 16 ret void } diff --git a/test/Linker/pr22807.ll b/test/Linker/pr22807.ll new file mode 100644 index 0000000..bb4ca2b --- /dev/null +++ b/test/Linker/pr22807.ll @@ -0,0 +1,13 @@ +; RUN: llvm-link -S -o - %p/pr22807.ll %p/Inputs/pr22807-1.ll %p/Inputs/pr22807-2.ll | FileCheck %s + +; CHECK-NOT: type +; CHECK: %struct.B = type { %struct.A* } +; CHECK-NEXT: %struct.A = type { %struct.B* } +; CHECK-NOT: type + +%struct.B = type { %struct.A* } +%struct.A = type opaque + +define i32 @baz(%struct.B* %BB) { + ret i32 0 +} diff --git a/test/Linker/replaced-function-matches-first-subprogram.ll b/test/Linker/replaced-function-matches-first-subprogram.ll index c0ec5f3..ac6633d 100644 --- a/test/Linker/replaced-function-matches-first-subprogram.ll +++ b/test/Linker/replaced-function-matches-first-subprogram.ll @@ -29,7 +29,7 @@ define linkonce_odr i32 @_ZN5ClassIiE3fooEv(%struct.Class* %this) align 2 { entry: %this.addr = alloca %struct.Class*, align 8 store %struct.Class* %this, %struct.Class** %this.addr, align 8 - %this1 = load %struct.Class** %this.addr + %this1 = load %struct.Class*, %struct.Class** %this.addr ret i32 0, !dbg !15 } @@ -39,33 +39,37 @@ entry: !llvm.ident = !{!13} ; Extract out the list of subprograms from each compile unit. -; CHECK-DAG: ![[CU1]] = !{!"0x11{{[^"]+}}", {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, ![[SPs1:[0-9]+]], -; CHECK-DAG: ![[CU2]] = !{!"0x11{{[^"]+}}", {{[^,]+}}, {{[^,]+}}, {{[^,]+}}, ![[SPs2:[0-9]+]], -!0 = !{!"0x11\004\00clang version 3.6.0 (trunk 224193) (llvm/trunk 224197)\000\00\000\00\002", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1/t1.cpp] [DW_LANG_C_plus_plus] -!1 = !{!"t1.cpp", !"/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1"} +; CHECK-DAG: ![[CU1]] = !MDCompileUnit({{.*}} subprograms: ![[SPs1:[0-9]+]] +; CHECK-DAG: ![[CU2]] = !MDCompileUnit({{.*}} subprograms: ![[SPs2:[0-9]+]] +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 224193) (llvm/trunk 224197)", isOptimized: false, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "t1.cpp", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1") !2 = !{} -; Extract out each compile unit's single subprogram. The replaced subprogram -; should be dropped by the first compile unit. -; CHECK-DAG: ![[SPs1]] = !{![[SP1:[0-9]+]]} +; Extract out each compile unit's single subprogram. The replaced subprogram's +; function should drop to null in the first compile unit. +; CHECK-DAG: ![[SPs1]] = !{![[SP1:[0-9]+]], ![[SP2r:[0-9]+]]} ; CHECK-DAG: ![[SPs2]] = !{![[SP2:[0-9]+]]} !3 = !{!4, !7} -!4 = !{!"0x2e\00foo\00foo\00\002\000\001\000\000\00256\000\002", !1, !5, !6, null, i32 ()* @_Z3foov, null, null, !2} ; [ DW_TAG_subprogram ] [line 2] [def] [foo] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1/t1.cpp] -!6 = !{!"0x15\00\000\000\000\000\000\000", null, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: i32 ()* @_Z3foov, variables: !2) +!5 = !MDFile(filename: "t1.cpp", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1") +!6 = !MDSubroutineType(types: !2) ; Extract out the file from the replaced subprogram. Confirm that each ; subprogram is pointing at the correct function. -; CHECK-DAG: ![[SP1]] = !{!"0x2e{{[^"]+}}", {{.*}}, i32 ()* @_Z3foov, -; CHECK-DAG: ![[SP2]] = !{!"0x2e{{[^"]+}}", ![[FILE:[0-9]+]], {{.*}}, i32 (%struct.Class*)* @_ZN5ClassIiE3fooEv, -!7 = !{!"0x2e\00foo\00foo\00\002\000\001\000\000\00256\000\002", !8, !9, !6, null, i32 (%struct.Class*)* @_ZN5ClassIiE3fooEv, null, null, !2} ; [ DW_TAG_subprogram ] [line 2] [def] [foo] +; CHECK-DAG: ![[SP1]] = !MDSubprogram({{.*}} function: i32 ()* @_Z3foov +; CHECK-DAG: ![[SP2]] = !MDSubprogram({{.*}} file: ![[FILE:[0-9]+]],{{.*}} function: i32 (%struct.Class*)* @_ZN5ClassIiE3fooEv + +; We can't use CHECK-NOT/CHECK-SAME with a CHECK-DAG, so rely on field order to +; prove that there's no function: here. +; CHECK-DAG: ![[SP2r]] = {{.*}}!MDSubprogram({{.*}} isOptimized: false, variables: +!7 = !MDSubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !8, scope: !9, type: !6, function: i32 (%struct.Class*)* @_ZN5ClassIiE3fooEv, variables: !2) ; The new subprogram should be pointing at the new directory. -; CHECK-DAG: ![[FILE]] = !{!"../t.h", !"/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d2"} -!8 = !{!"../t.h", !"/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1"} -!9 = !{!"0x29", !8} ; [ DW_TAG_file_type ] [/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1/../t.h] +; CHECK-DAG: ![[FILE]] = !MDFile(filename: "../t.h", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d2") +!8 = !MDFile(filename: "../t.h", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1") +!9 = !MDFile(filename: "../t.h", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1") !10 = !{i32 2, !"Dwarf Version", i32 2} -!11 = !{i32 2, !"Debug Info Version", i32 2} +!11 = !{i32 2, !"Debug Info Version", i32 3} !12 = !{i32 1, !"PIC Level", i32 2} !13 = !{!"clang version 3.6.0 (trunk 224193) (llvm/trunk 224197)"} !14 = !MDLocation(line: 2, column: 20, scope: !4) diff --git a/test/Linker/subprogram-linkonce-weak-odr.ll b/test/Linker/subprogram-linkonce-weak-odr.ll new file mode 100644 index 0000000..97058fd --- /dev/null +++ b/test/Linker/subprogram-linkonce-weak-odr.ll @@ -0,0 +1,177 @@ +; RUN: llvm-link %s %S/Inputs/subprogram-linkonce-weak-odr.ll -S -o %t1 +; RUN: FileCheck %s -check-prefix=LW -check-prefix=CHECK <%t1 +; RUN: llvm-link %S/Inputs/subprogram-linkonce-weak-odr.ll %s -S -o %t2 +; RUN: FileCheck %s -check-prefix=WL -check-prefix=CHECK <%t2 + +; This testcase tests the following flow: +; - File A defines a linkonce_odr version of @foo which has inlined into @bar. +; - File B defines a weak_odr version of @foo (identical definition). +; - Linkage rules state File B version of @foo wins. +; - Debug info for the subprograms of @foo match exactly. Without +; intervention, the same subprogram would show up in both compile units, and +; it would get associated with the compile unit where it was linkonce. +; - @bar has inlined debug info related to the linkonce_odr @foo. +; +; This checks a corner case for the fix for PR22792, where subprograms match +; exactly. It's a companion for subprogram-linkonce-weak.ll. + +; The LW prefix means linkonce (this file) first, then weak (the other file). +; The WL prefix means weak (the other file) first, then linkonce (this file). + +; We'll see @bar before @foo if this file is first. +; LW-LABEL: define i32 @bar( +; LW: %sum = add i32 %a, %b, !dbg ![[FOOINBAR:[0-9]+]] +; LW: ret i32 %sum, !dbg ![[BARRET:[0-9]+]] +; LW-LABEL: define weak_odr i32 @foo( +; LW: %sum = add i32 %a, %b, !dbg ![[FOOADD:[0-9]+]] +; LW: ret i32 %sum, !dbg ![[FOORET:[0-9]+]] + +; We'll see @foo before @bar if this file is second. +; WL-LABEL: define weak_odr i32 @foo( +; WL: %sum = add i32 %a, %b, !dbg ![[FOOADD:[0-9]+]] +; WL: ret i32 %sum, !dbg ![[FOORET:[0-9]+]] +; WL-LABEL: define i32 @bar( +; WL: %sum = add i32 %a, %b, !dbg ![[FOOINBAR:[0-9]+]] +; WL: ret i32 %sum, !dbg ![[BARRET:[0-9]+]] + +define i32 @bar(i32 %a, i32 %b) { +entry: + %sum = add i32 %a, %b, !dbg !MDLocation(line: 2, scope: !4, + inlinedAt: !MDLocation(line: 12, scope: !3)) + ret i32 %sum, !dbg !MDLocation(line: 13, scope: !3) +} + +define linkonce_odr i32 @foo(i32 %a, i32 %b) { +entry: + %sum = add i32 %a, %b, !dbg !MDLocation(line: 2, scope: !4) + ret i32 %sum, !dbg !MDLocation(line: 3, scope: !4) +} + +!llvm.module.flags = !{!0} +!0 = !{i32 2, !"Debug Info Version", i32 3} + +; CHECK-LABEL: !llvm.dbg.cu = +; LW-SAME: !{![[LCU:[0-9]+]], ![[WCU:[0-9]+]]} +; WL-SAME: !{![[WCU:[0-9]+]], ![[LCU:[0-9]+]]} +!llvm.dbg.cu = !{!1} + +; LW: ![[LCU]] = !MDCompileUnit({{.*}} subprograms: ![[LSPs:[0-9]+]] +; LW: ![[LSPs]] = !{![[BARSP:[0-9]+]], ![[FOOSP:[0-9]+]]} +; LW: ![[BARSP]] = !MDSubprogram(name: "bar", +; LW-SAME: function: i32 (i32, i32)* @bar +; LW: ![[FOOSP]] = {{.*}}!MDSubprogram(name: "foo", +; LW-NOT: function: +; LW-SAME: ){{$}} +; LW: ![[WCU]] = !MDCompileUnit({{.*}} subprograms: ![[WSPs:[0-9]+]] +; LW: ![[WSPs]] = !{![[WEAKFOOSP:[0-9]+]]} +; LW: ![[WEAKFOOSP]] = !MDSubprogram(name: "foo", +; LW-SAME: function: i32 (i32, i32)* @foo +; LW: ![[FOOINBAR]] = !MDLocation(line: 2, scope: ![[FOOSP]], inlinedAt: ![[BARIA:[0-9]+]]) +; LW: ![[BARIA]] = !MDLocation(line: 12, scope: ![[BARSP]]) +; LW: ![[BARRET]] = !MDLocation(line: 13, scope: ![[BARSP]]) +; LW: ![[FOOADD]] = !MDLocation(line: 2, scope: ![[WEAKFOOSP]]) +; LW: ![[FOORET]] = !MDLocation(line: 3, scope: ![[WEAKFOOSP]]) + +; Same as above, but reordered. +; WL: ![[WCU]] = !MDCompileUnit({{.*}} subprograms: ![[WSPs:[0-9]+]] +; WL: ![[WSPs]] = !{![[WEAKFOOSP:[0-9]+]]} +; WL: ![[WEAKFOOSP]] = !MDSubprogram(name: "foo", +; WL-SAME: function: i32 (i32, i32)* @foo +; WL: ![[LCU]] = !MDCompileUnit({{.*}} subprograms: ![[LSPs:[0-9]+]] +; Note: for symmetry, LSPs would have a different copy of the subprogram. +; WL: ![[LSPs]] = !{![[BARSP:[0-9]+]], ![[WEAKFOOSP:[0-9]+]]} +; WL: ![[BARSP]] = !MDSubprogram(name: "bar", +; WL-SAME: function: i32 (i32, i32)* @bar +; WL: ![[FOOADD]] = !MDLocation(line: 2, scope: ![[WEAKFOOSP]]) +; WL: ![[FOORET]] = !MDLocation(line: 3, scope: ![[WEAKFOOSP]]) +; WL: ![[FOOINBAR]] = !MDLocation(line: 2, scope: ![[WEAKFOOSP]], inlinedAt: ![[BARIA:[0-9]+]]) +; WL: ![[BARIA]] = !MDLocation(line: 12, scope: ![[BARSP]]) +; WL: ![[BARRET]] = !MDLocation(line: 13, scope: ![[BARSP]]) + +!1 = !MDCompileUnit(language: DW_LANG_C99, file: !2, subprograms: !{!3, !4}, emissionKind: 1) +!2 = !MDFile(filename: "bar.c", directory: "/path/to/dir") +!3 = !MDSubprogram(file: !2, scope: !2, line: 11, name: "bar", function: i32 (i32, i32)* @bar, type: !6) +!4 = !MDSubprogram(file: !5, scope: !5, line: 1, name: "foo", function: i32 (i32, i32)* @foo, type: !6) +!5 = !MDFile(filename: "foo.h", directory: "/path/to/dir") +!6 = !MDSubroutineType(types: !{}) + +; Crasher for llc. +; REQUIRES: object-emission +; RUN: %llc_dwarf -filetype=obj -O0 %t1 -o %t1.o +; RUN: llvm-dwarfdump %t1.o -debug-dump=all | FileCheck %s -check-prefix=DWLW -check-prefix=DW +; RUN: %llc_dwarf -filetype=obj -O0 %t2 -o %t2.o +; RUN: llvm-dwarfdump %t2.o -debug-dump=all | FileCheck %s -check-prefix=DWWL -check-prefix=DW +; Check that the debug info puts the subprogram (with PCs) in the correct +; compile unit. + +; DW-LABEL: .debug_info contents: +; DWLW: DW_TAG_compile_unit +; DWLW: DW_AT_name {{.*}}"bar.c" +; Note: If we stop emitting foo here, the comment below for DWWL (and the +; check) should be copied up here. +; DWLW: DW_TAG_subprogram +; DWLW-NOT: DW_AT_low_pc +; DWLW-NOT: DW_AT_high_pc +; DWLW: DW_AT_name {{.*}}foo +; DWLW: DW_AT_decl_file {{.*}}"/path/to/dir/foo.h" +; DWLW: DW_AT_decl_line {{.*}}(1) +; DWLW: DW_TAG_subprogram +; DWLW: DW_AT_low_pc +; DWLW: DW_AT_high_pc +; DWLW: DW_AT_name {{.*}}bar +; DWLW: DW_AT_decl_file {{.*}}"/path/to/dir/bar.c" +; DWLW: DW_AT_decl_line {{.*}}(11) +; DWLW: DW_TAG_inlined_subroutine +; DWLW: DW_AT_abstract_origin +; DWLW: DW_TAG_compile_unit +; DWLW: DW_AT_name {{.*}}"foo.c" +; DWLW: DW_TAG_subprogram +; DWLW: DW_AT_low_pc +; DWLW: DW_AT_high_pc +; DWLW: DW_AT_name {{.*}}foo +; DWLW: DW_AT_decl_file {{.*}}"/path/to/dir/foo.h" +; DWLW: DW_AT_decl_line {{.*}}(1) + +; The DWARF output is already symmetric (just reordered). +; DWWL: DW_TAG_compile_unit +; DWWL: DW_AT_name {{.*}}"foo.c" +; DWWL: DW_TAG_subprogram +; DWWL: DW_AT_low_pc +; DWWL: DW_AT_high_pc +; DWWL: DW_AT_name {{.*}}foo +; DWWL: DW_AT_decl_file {{.*}}"/path/to/dir/foo.h" +; DWWL: DW_AT_decl_line {{.*}}(1) +; DWWL: DW_TAG_compile_unit +; DWWL: DW_AT_name {{.*}}"bar.c" +; Note: for symmetry, foo would also show up in this compile unit +; (alternatively, it wouldn't show up in the DWLW case). If we start emitting +; foo here, this should be updated by checking that we don't emit low_pc and +; high_pc for it. +; DWWL-NOT: DW_AT_name {{.*}}foo +; DWWL: DW_TAG_subprogram +; DWWL-NOT: DW_AT_name {{.*}}foo +; DWWL: DW_AT_low_pc +; DWWL: DW_AT_high_pc +; DWWL-NOT: DW_AT_name {{.*}}foo +; DWWL: DW_AT_name {{.*}}bar +; DWWL: DW_AT_decl_file {{.*}}"/path/to/dir/bar.c" +; DWWL: DW_AT_decl_line {{.*}}(11) +; DWWL: DW_TAG_inlined_subroutine +; DWWL: DW_AT_abstract_origin + +; DW-LABEL: .debug_line contents: +; Check that we have the right things in the line table as well. + +; DWLW-LABEL: file_names[{{ *}}1]{{.*}} bar.c +; DWLW-LABEL: file_names[{{ *}}2]{{.*}} foo.h +; DWLW: 2 0 2 0 0 is_stmt prologue_end +; DWLW-LABEL: file_names[{{ *}}1]{{.*}} foo.h +; DWLW: 2 0 1 0 0 is_stmt prologue_end +; DWLW-NOT: prologue_end + +; DWWL-LABEL: file_names[{{ *}}1]{{.*}} foo.h +; DWWL: 2 0 1 0 0 is_stmt prologue_end +; DWWL-LABEL: file_names[{{ *}}1]{{.*}} bar.c +; DWWL-LABEL: file_names[{{ *}}2]{{.*}} foo.h +; DWWL: 2 0 2 0 0 is_stmt prologue_end +; DWWL-NOT: prologue_end diff --git a/test/Linker/subprogram-linkonce-weak.ll b/test/Linker/subprogram-linkonce-weak.ll new file mode 100644 index 0000000..42a8b39 --- /dev/null +++ b/test/Linker/subprogram-linkonce-weak.ll @@ -0,0 +1,171 @@ +; RUN: llvm-link %s %S/Inputs/subprogram-linkonce-weak.ll -S -o %t1 +; RUN: FileCheck %s -check-prefix=LW -check-prefix=CHECK <%t1 +; RUN: llvm-link %S/Inputs/subprogram-linkonce-weak.ll %s -S -o %t2 +; RUN: FileCheck %s -check-prefix=WL -check-prefix=CHECK <%t2 + +; This testcase tests the following flow: +; - File A defines a linkonce version of @foo which has inlined into @bar. +; - File B defines a weak version of @foo (different definition). +; - Linkage rules state File B version of @foo wins. +; - @bar still has inlined debug info related to the linkonce @foo. +; +; This should fix PR22792, although the testcase was hand-written. There's a +; RUN line with a crasher for llc at the end with checks for the DWARF output. + +; The LW prefix means linkonce (this file) first, then weak (the other file). +; The WL prefix means weak (the other file) first, then linkonce (this file). + +; We'll see @bar before @foo if this file is first. +; LW-LABEL: define i32 @bar( +; LW: %sum = add i32 %a, %b, !dbg ![[FOOINBAR:[0-9]+]] +; LW: ret i32 %sum, !dbg ![[BARRET:[0-9]+]] +; LW-LABEL: define weak i32 @foo( +; LW: %sum = call i32 @fastadd(i32 %a, i32 %b), !dbg ![[FOOCALL:[0-9]+]] +; LW: ret i32 %sum, !dbg ![[FOORET:[0-9]+]] + +; We'll see @foo before @bar if this file is second. +; WL-LABEL: define weak i32 @foo( +; WL: %sum = call i32 @fastadd(i32 %a, i32 %b), !dbg ![[FOOCALL:[0-9]+]] +; WL: ret i32 %sum, !dbg ![[FOORET:[0-9]+]] +; WL-LABEL: define i32 @bar( +; WL: %sum = add i32 %a, %b, !dbg ![[FOOINBAR:[0-9]+]] +; WL: ret i32 %sum, !dbg ![[BARRET:[0-9]+]] + +define i32 @bar(i32 %a, i32 %b) { +entry: + %sum = add i32 %a, %b, !dbg !MDLocation(line: 2, scope: !4, + inlinedAt: !MDLocation(line: 12, scope: !3)) + ret i32 %sum, !dbg !MDLocation(line: 13, scope: !3) +} + +define linkonce i32 @foo(i32 %a, i32 %b) { +entry: + %sum = add i32 %a, %b, !dbg !MDLocation(line: 2, scope: !4) + ret i32 %sum, !dbg !MDLocation(line: 3, scope: !4) +} + +!llvm.module.flags = !{!0} +!0 = !{i32 2, !"Debug Info Version", i32 3} + +; CHECK-LABEL: !llvm.dbg.cu = +; LW-SAME: !{![[LCU:[0-9]+]], ![[WCU:[0-9]+]]} +; WL-SAME: !{![[WCU:[0-9]+]], ![[LCU:[0-9]+]]} +!llvm.dbg.cu = !{!1} + +; LW: ![[LCU]] = !MDCompileUnit({{.*}} subprograms: ![[LSPs:[0-9]+]] +; LW: ![[LSPs]] = !{![[BARSP:[0-9]+]], ![[FOOSP:[0-9]+]]} +; LW: ![[BARSP]] = !MDSubprogram(name: "bar", +; LW-SAME: function: i32 (i32, i32)* @bar +; LW: ![[FOOSP]] = {{.*}}!MDSubprogram(name: "foo", +; LW-NOT: function: +; LW-SAME: ){{$}} +; LW: ![[WCU]] = !MDCompileUnit({{.*}} subprograms: ![[WSPs:[0-9]+]] +; LW: ![[WSPs]] = !{![[WEAKFOOSP:[0-9]+]]} +; LW: ![[WEAKFOOSP]] = !MDSubprogram(name: "foo", +; LW-SAME: function: i32 (i32, i32)* @foo +; LW: ![[FOOINBAR]] = !MDLocation(line: 2, scope: ![[FOOSP]], inlinedAt: ![[BARIA:[0-9]+]]) +; LW: ![[BARIA]] = !MDLocation(line: 12, scope: ![[BARSP]]) +; LW: ![[BARRET]] = !MDLocation(line: 13, scope: ![[BARSP]]) +; LW: ![[FOOCALL]] = !MDLocation(line: 52, scope: ![[WEAKFOOSP]]) +; LW: ![[FOORET]] = !MDLocation(line: 53, scope: ![[WEAKFOOSP]]) + +; Same as above, but reordered. +; WL: ![[WCU]] = !MDCompileUnit({{.*}} subprograms: ![[WSPs:[0-9]+]] +; WL: ![[WSPs]] = !{![[WEAKFOOSP:[0-9]+]]} +; WL: ![[WEAKFOOSP]] = !MDSubprogram(name: "foo", +; WL-SAME: function: i32 (i32, i32)* @foo +; WL: ![[LCU]] = !MDCompileUnit({{.*}} subprograms: ![[LSPs:[0-9]+]] +; WL: ![[LSPs]] = !{![[BARSP:[0-9]+]], ![[FOOSP:[0-9]+]]} +; WL: ![[BARSP]] = !MDSubprogram(name: "bar", +; WL-SAME: function: i32 (i32, i32)* @bar +; WL: ![[FOOSP]] = {{.*}}!MDSubprogram(name: "foo", +; Note, for symmetry, this should be "NOT: function:" and "SAME: ){{$}}". +; WL-SAME: function: i32 (i32, i32)* @foo +; WL: ![[FOOCALL]] = !MDLocation(line: 52, scope: ![[WEAKFOOSP]]) +; WL: ![[FOORET]] = !MDLocation(line: 53, scope: ![[WEAKFOOSP]]) +; WL: ![[FOOINBAR]] = !MDLocation(line: 2, scope: ![[FOOSP]], inlinedAt: ![[BARIA:[0-9]+]]) +; WL: ![[BARIA]] = !MDLocation(line: 12, scope: ![[BARSP]]) +; WL: ![[BARRET]] = !MDLocation(line: 13, scope: ![[BARSP]]) + +!1 = !MDCompileUnit(language: DW_LANG_C99, file: !2, subprograms: !{!3, !4}, emissionKind: 1) +!2 = !MDFile(filename: "bar.c", directory: "/path/to/dir") +!3 = !MDSubprogram(file: !2, scope: !2, line: 11, name: "bar", function: i32 (i32, i32)* @bar, type: !5) +!4 = !MDSubprogram(file: !2, scope: !2, line: 1, name: "foo", function: i32 (i32, i32)* @foo, type: !5) +!5 = !MDSubroutineType(types: !{}) + +; Crasher for llc. +; REQUIRES: object-emission +; RUN: %llc_dwarf -filetype=obj -O0 %t1 -o %t1.o +; RUN: llvm-dwarfdump %t1.o -debug-dump=all | FileCheck %s -check-prefix=DWLW -check-prefix=DW +; RUN: %llc_dwarf -filetype=obj -O0 %t2 -o %t2.o +; RUN: llvm-dwarfdump %t2.o -debug-dump=all | FileCheck %s -check-prefix=DWWL -check-prefix=DW +; Check that the debug info for the discarded linkonce version of @foo doesn't +; reference any code, and that the other subprograms look correct. + +; DW-LABEL: .debug_info contents: +; DWLW: DW_TAG_compile_unit +; DWLW: DW_AT_name {{.*}}"bar.c" +; DWLW: DW_TAG_subprogram +; DWLW-NOT: DW_AT_low_pc +; DWLW-NOT: DW_AT_high_pc +; DWLW: DW_AT_name {{.*}}foo +; DWLW: DW_AT_decl_file {{.*}}"/path/to/dir/bar.c" +; DWLW: DW_AT_decl_line {{.*}}(1) +; DWLW: DW_TAG_subprogram +; DWLW: DW_AT_low_pc +; DWLW: DW_AT_high_pc +; DWLW: DW_AT_name {{.*}}bar +; DWLW: DW_AT_decl_file {{.*}}"/path/to/dir/bar.c" +; DWLW: DW_AT_decl_line {{.*}}(11) + +; DWLW: DW_TAG_inlined_subroutine +; DWLW: DW_AT_abstract_origin +; DWLW: DW_TAG_compile_unit +; DWLW: DW_AT_name {{.*}}"foo.c" +; DWLW: DW_TAG_subprogram +; DWLW: DW_AT_low_pc +; DWLW: DW_AT_high_pc +; DWLW: DW_AT_name {{.*}}foo +; DWLW: DW_AT_decl_file {{.*}}"/path/to/dir/foo.c" +; DWLW: DW_AT_decl_line {{.*}}(51) + +; The DWARF output is already symmetric (just reordered). +; DWWL: DW_TAG_compile_unit +; DWWL: DW_AT_name {{.*}}"foo.c" +; DWWL: DW_TAG_subprogram +; DWWL: DW_AT_low_pc +; DWWL: DW_AT_high_pc +; DWWL: DW_AT_name {{.*}}foo +; DWWL: DW_AT_decl_file {{.*}}"/path/to/dir/foo.c" +; DWWL: DW_AT_decl_line {{.*}}(51) +; DWWL: DW_TAG_compile_unit +; DWWL: DW_AT_name {{.*}}"bar.c" +; DWWL: DW_TAG_subprogram +; DWWL-NOT: DW_AT_low_pc +; DWWL-NOT: DW_AT_high_pc +; DWWL: DW_AT_name {{.*}}foo +; DWWL: DW_AT_decl_file {{.*}}"/path/to/dir/bar.c" +; DWWL: DW_AT_decl_line {{.*}}(1) +; DWWL: DW_TAG_subprogram +; DWWL: DW_AT_low_pc +; DWWL: DW_AT_high_pc +; DWWL: DW_AT_name {{.*}}bar +; DWWL: DW_AT_decl_file {{.*}}"/path/to/dir/bar.c" +; DWWL: DW_AT_decl_line {{.*}}(11) +; DWWL: DW_TAG_inlined_subroutine +; DWWL: DW_AT_abstract_origin + +; DW-LABEL: .debug_line contents: +; Check that we have the right things in the line table as well. + +; DWLW-LABEL: file_names[{{ *}}1]{{.*}} bar.c +; DWLW: 2 0 1 0 0 is_stmt prologue_end +; DWLW-LABEL: file_names[{{ *}}1]{{.*}} foo.c +; DWLW: 52 0 1 0 0 is_stmt prologue_end +; DWLW-NOT: prologue_end + +; DWWL-LABEL: file_names[{{ *}}1]{{.*}} foo.c +; DWWL: 52 0 1 0 0 is_stmt prologue_end +; DWWL-LABEL: file_names[{{ *}}1]{{.*}} bar.c +; DWWL: 2 0 1 0 0 is_stmt prologue_end +; DWWL-NOT: prologue_end diff --git a/test/Linker/targettriple.ll b/test/Linker/targettriple.ll index 8778706..a159797 100644 --- a/test/Linker/targettriple.ll +++ b/test/Linker/targettriple.ll @@ -1,4 +1,3 @@ -; REQUIRES: shell ; RUN: llvm-link %s %S/Inputs/targettriple-a.ll -S -o - 2>%t.a.err | FileCheck %s ; RUN: cat %t.a.err | FileCheck --check-prefix=WARN-A %s --allow-empty diff --git a/test/Linker/testlink.ll b/test/Linker/testlink.ll index aad4b9b..5488fcc 100644 --- a/test/Linker/testlink.ll +++ b/test/Linker/testlink.ll @@ -76,15 +76,15 @@ declare i32 @foo(i32) declare void @print(i32) define void @main() { - %v1 = load i32* @MyVar + %v1 = load i32, i32* @MyVar call void @print(i32 %v1) - %idx = getelementptr %intlist* @MyIntList, i64 0, i32 1 - %v2 = load i32* %idx + %idx = getelementptr %intlist, %intlist* @MyIntList, i64 0, i32 1 + %v2 = load i32, i32* %idx call void @print(i32 %v2) %1 = call i32 @foo(i32 5) - %v3 = load i32* @MyVar + %v3 = load i32, i32* @MyVar call void @print(i32 %v3) - %v4 = load i32* %idx + %v4 = load i32, i32* %idx call void @print(i32 %v4) ret void } diff --git a/test/Linker/type-unique-odr-a.ll b/test/Linker/type-unique-odr-a.ll index 900b035..2321c01 100644 --- a/test/Linker/type-unique-odr-a.ll +++ b/test/Linker/type-unique-odr-a.ll @@ -30,15 +30,15 @@ ; CHECK-NOT: DW_TAG ; CHECK: DW_TAG_subprogram ; CHECK-NOT: DW_TAG -; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZN1A6getFooEv" +; CHECK: DW_AT_linkage_name {{.*}} "_ZN1A6getFooEv" ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_name {{.*}} "getFoo" ; CHECK: DW_TAG_subprogram ; CHECK-NOT: DW_TAG -; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_Z3bazv" +; CHECK: DW_AT_linkage_name {{.*}} "_Z3bazv" ; CHECK: DW_TAG_subprogram ; CHECK-NOT: DW_TAG -; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZL3barv" +; CHECK: DW_AT_linkage_name {{.*}} "_ZL3barv" ; getFoo and A may only appear once. ; CHECK-NOT: AT_name{{.*(getFoo)|("A")}} @@ -59,7 +59,7 @@ entry: define internal void @_ZL3barv() #0 { entry: %a = alloca %class.A, align 4 - call void @llvm.dbg.declare(metadata %class.A* %a, metadata !24, metadata !{!"0x102"}), !dbg !25 + call void @llvm.dbg.declare(metadata %class.A* %a, metadata !24, metadata !MDExpression()), !dbg !25 ret void, !dbg !26 } @@ -73,30 +73,30 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!20, !21} !llvm.ident = !{!22} -!0 = !{!"0x11\004\00clang version 3.5.0 \000\00\000\00\001", !1, !2, !3, !14, !2, !2} ; [ DW_TAG_compile_unit ] [<unknown>] [DW_LANG_C_plus_plus] -!1 = !{!"<unknown>", !""} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !14, globals: !2, imports: !2) +!1 = !MDFile(filename: "<unknown>", directory: "") !2 = !{} !3 = !{!4} -!4 = !{!"0x2\00A\001\0032\0032\000\000\000", !5, null, null, !6, null, null, !"_ZTS1A"} ; [ DW_TAG_class_type ] [A] [line 1, size 32, align 32, offset 0] [def] [from ] -!5 = !{!"type-unique-odr-a.cpp", !""} +!4 = !MDCompositeType(tag: DW_TAG_class_type, name: "A", line: 1, size: 32, align: 32, file: !5, elements: !6, identifier: "_ZTS1A") +!5 = !MDFile(filename: "type-unique-odr-a.cpp", directory: "") !6 = !{!7, !9} -!7 = !{!"0xd\00data\002\0032\0032\000\001", !5, !"_ZTS1A", !8} ; [ DW_TAG_member ] [data] [line 2, size 32, align 32, offset 0] [private] [from int] -!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] -!9 = !{!"0x2e\00getFoo\00getFoo\00_ZN1A6getFooEv\004\000\000\000\006\00258\000\004", !5, !"_ZTS1A", !10, null, null, null, i32 0, !13} ; [ DW_TAG_subprogram ] [line 4] [protected] [getFoo] -!10 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !11, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!7 = !MDDerivedType(tag: DW_TAG_member, name: "data", line: 2, size: 32, align: 32, flags: DIFlagPrivate, file: !5, scope: !"_ZTS1A", baseType: !8) +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !MDSubprogram(name: "getFoo", linkageName: "_ZN1A6getFooEv", line: 4, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagProtected | DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !5, scope: !"_ZTS1A", type: !10, variables: !13) +!10 = !MDSubroutineType(types: !11) !11 = !{null, !12} -!12 = !{!"0xf\00\000\0064\0064\000\001088", null, null, !"_ZTS1A"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS1A] +!12 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") !13 = !{i32 786468} !14 = !{!15, !19} -!15 = !{!"0x2e\00baz\00baz\00_Z3bazv\0011\000\001\000\006\00256\000\0011", !5, !16, !17, null, void ()* @_Z3bazv, null, null, !2} ; [ DW_TAG_subprogram ] [line 11] [def] [baz] -!16 = !{!"0x29", !5} ; [ DW_TAG_file_type ] [type-unique-odr-a.cpp] -!17 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !18, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!15 = !MDSubprogram(name: "baz", linkageName: "_Z3bazv", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 11, file: !5, scope: !16, type: !17, function: void ()* @_Z3bazv, variables: !2) +!16 = !MDFile(filename: "type-unique-odr-a.cpp", directory: "") +!17 = !MDSubroutineType(types: !18) !18 = !{null} -!19 = !{!"0x2e\00bar\00bar\00_ZL3barv\007\001\001\000\006\00256\000\007", !5, !16, !17, null, void ()* @_ZL3barv, null, null, !2} ; [ DW_TAG_subprogram ] [line 7] [local] [def] [bar] +!19 = !MDSubprogram(name: "bar", linkageName: "_ZL3barv", line: 7, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !5, scope: !16, type: !17, function: void ()* @_ZL3barv, variables: !2) !20 = !{i32 2, !"Dwarf Version", i32 4} -!21 = !{i32 1, !"Debug Info Version", i32 2} +!21 = !{i32 1, !"Debug Info Version", i32 3} !22 = !{!"clang version 3.5.0 "} !23 = !MDLocation(line: 11, scope: !15) -!24 = !{!"0x100\00a\008\000", !19, !16, !"_ZTS1A"} ; [ DW_TAG_auto_variable ] [a] [line 8] +!24 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 8, scope: !19, file: !16, type: !"_ZTS1A") !25 = !MDLocation(line: 8, scope: !19) !26 = !MDLocation(line: 9, scope: !19) diff --git a/test/Linker/type-unique-odr-b.ll b/test/Linker/type-unique-odr-b.ll index b262191..7123619 100644 --- a/test/Linker/type-unique-odr-b.ll +++ b/test/Linker/type-unique-odr-b.ll @@ -26,8 +26,8 @@ define void @_ZN1A6getFooEv(%class.A* %this) #0 align 2 { entry: %this.addr = alloca %class.A*, align 8 store %class.A* %this, %class.A** %this.addr, align 8 - call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !24, metadata !{!"0x102"}), !dbg !26 - %this1 = load %class.A** %this.addr + call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !24, metadata !MDExpression()), !dbg !26 + %this1 = load %class.A*, %class.A** %this.addr ret void, !dbg !27 } @@ -54,32 +54,32 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!21, !22} !llvm.ident = !{!23} -!0 = !{!"0x11\004\00clang version 3.5.0 \000\00\000\00\001", !1, !2, !3, !14, !2, !2} ; [ DW_TAG_compile_unit ] [<unknown>] [DW_LANG_C_plus_plus] -!1 = !{!"<unknown>", !""} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !14, globals: !2, imports: !2) +!1 = !MDFile(filename: "<unknown>", directory: "") !2 = !{} !3 = !{!4} -!4 = !{!"0x2\00A\002\0032\0032\000\000\000", !5, null, null, !6, null, null, !"_ZTS1A"} ; [ DW_TAG_class_type ] [A] [line 2, size 32, align 32, offset 0] [def] [from ] -!5 = !{!"type-unique-odr-b.cpp", !""} +!4 = !MDCompositeType(tag: DW_TAG_class_type, name: "A", line: 2, size: 32, align: 32, file: !5, elements: !6, identifier: "_ZTS1A") +!5 = !MDFile(filename: "type-unique-odr-b.cpp", directory: "") !6 = !{!7, !9} -!7 = !{!"0xd\00data\003\0032\0032\000\001", !5, !"_ZTS1A", !8} ; [ DW_TAG_member ] [data] [line 3, size 32, align 32, offset 0] [private] [from int] -!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] -!9 = !{!"0x2e\00getFoo\00getFoo\00_ZN1A6getFooEv\005\000\000\000\006\00258\000\005", !5, !"_ZTS1A", !10, null, null, null, i32 0, !13} ; [ DW_TAG_subprogram ] [line 5] [protected] [getFoo] -!10 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !11, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!7 = !MDDerivedType(tag: DW_TAG_member, name: "data", line: 3, size: 32, align: 32, flags: DIFlagPrivate, file: !5, scope: !"_ZTS1A", baseType: !8) +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !MDSubprogram(name: "getFoo", linkageName: "_ZN1A6getFooEv", line: 5, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagProtected | DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !5, scope: !"_ZTS1A", type: !10, variables: !13) +!10 = !MDSubroutineType(types: !11) !11 = !{null, !12} -!12 = !{!"0xf\00\000\0064\0064\000\001088", null, null, !"_ZTS1A"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS1A] +!12 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") !13 = !{i32 786468} !14 = !{!15, !16, !20} -!15 = !{!"0x2e\00getFoo\00getFoo\00_ZN1A6getFooEv\008\000\001\000\006\00256\000\008", !5, !"_ZTS1A", !10, null, void (%class.A*)* @_ZN1A6getFooEv, null, !9, !2} ; [ DW_TAG_subprogram ] [line 8] [def] [getFoo] -!16 = !{!"0x2e\00f\00f\00_Z1fv\0011\000\001\000\006\00256\000\0011", !5, !17, !18, null, void ()* @_Z1fv, null, null, !2} ; [ DW_TAG_subprogram ] [line 11] [def] [f] -!17 = !{!"0x29", !5} ; [ DW_TAG_file_type ] [type-unique-odr-b.cpp] -!18 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !19, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!15 = !MDSubprogram(name: "getFoo", linkageName: "_ZN1A6getFooEv", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !5, scope: !"_ZTS1A", type: !10, function: void (%class.A*)* @_ZN1A6getFooEv, declaration: !9, variables: !2) +!16 = !MDSubprogram(name: "f", linkageName: "_Z1fv", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 11, file: !5, scope: !17, type: !18, function: void ()* @_Z1fv, variables: !2) +!17 = !MDFile(filename: "type-unique-odr-b.cpp", directory: "") +!18 = !MDSubroutineType(types: !19) !19 = !{null} -!20 = !{!"0x2e\00bar\00bar\00_ZL3barv\0010\001\001\000\006\00256\000\0010", !5, !17, !18, null, void ()* @_ZL3barv, null, null, !2} ; [ DW_TAG_subprogram ] [line 10] [local] [def] [bar] +!20 = !MDSubprogram(name: "bar", linkageName: "_ZL3barv", line: 10, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !5, scope: !17, type: !18, function: void ()* @_ZL3barv, variables: !2) !21 = !{i32 2, !"Dwarf Version", i32 4} -!22 = !{i32 1, !"Debug Info Version", i32 2} +!22 = !{i32 1, !"Debug Info Version", i32 3} !23 = !{!"clang version 3.5.0 "} -!24 = !{!"0x101\00this\0016777216\001088", !15, null, !25} ; [ DW_TAG_arg_variable ] [this] [line 0] -!25 = !{!"0xf\00\000\0064\0064\000\000", null, null, !"_ZTS1A"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from _ZTS1A] +!24 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !15, type: !25) +!25 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1A") !26 = !MDLocation(line: 0, scope: !15) !27 = !MDLocation(line: 8, scope: !15) !28 = !MDLocation(line: 11, scope: !16) diff --git a/test/Linker/type-unique-simple-a.ll b/test/Linker/type-unique-simple-a.ll index ef29cd9..2ff60a1 100644 --- a/test/Linker/type-unique-simple-a.ll +++ b/test/Linker/type-unique-simple-a.ll @@ -54,8 +54,8 @@ entry: %a.addr = alloca i32, align 4 %t = alloca %struct.Base, align 4 store i32 %a, i32* %a.addr, align 4 - call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !15, metadata !{!"0x102"}), !dbg !16 - call void @llvm.dbg.declare(metadata %struct.Base* %t, metadata !17, metadata !{!"0x102"}), !dbg !18 + call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !15, metadata !MDExpression()), !dbg !16 + call void @llvm.dbg.declare(metadata %struct.Base* %t, metadata !17, metadata !MDExpression()), !dbg !18 ret void, !dbg !19 } @@ -68,24 +68,24 @@ attributes #1 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!14, !20} -!0 = !{!"0x11\004\00clang version 3.4 (http://llvm.org/git/clang.git c23b1db6268c8e7ce64026d57d1510c1aac200a0) (http://llvm.org/git/llvm.git 09b98fe3978eddefc2145adc1056cf21580ce945)\000\00\000\00\000", !1, !2, !3, !9, !2, !2} ; [ DW_TAG_compile_unit ] [/Users/mren/c_testing/type_unique_air/simple/foo.cpp] [DW_LANG_C_plus_plus] -!1 = !{!"foo.cpp", !"/Users/mren/c_testing/type_unique_air/simple"} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (http://llvm.org/git/clang.git c23b1db6268c8e7ce64026d57d1510c1aac200a0) (http://llvm.org/git/llvm.git 09b98fe3978eddefc2145adc1056cf21580ce945)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !9, globals: !2, imports: !2) +!1 = !MDFile(filename: "foo.cpp", directory: "/Users/mren/c_testing/type_unique_air/simple") !2 = !{} !3 = !{!4} -!4 = !{!"0x13\00Base\001\0032\0032\000\000\000", !5, null, null, !6, null, null, !"_ZTS4Base"} ; [ DW_TAG_structure_type ] [Base] [line 1, size 32, align 32, offset 0] [def] [from ] -!5 = !{!"./a.hpp", !"/Users/mren/c_testing/type_unique_air/simple"} +!4 = !MDCompositeType(tag: DW_TAG_structure_type, name: "Base", line: 1, size: 32, align: 32, file: !5, elements: !6, identifier: "_ZTS4Base") +!5 = !MDFile(filename: "./a.hpp", directory: "/Users/mren/c_testing/type_unique_air/simple") !6 = !{!7} -!7 = !{!"0xd\00a\002\0032\0032\000\000", !5, !"_ZTS4Base", !8} ; [ DW_TAG_member ] [a] [line 2, size 32, align 32, offset 0] [from int] -!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] +!7 = !MDDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, file: !5, scope: !"_ZTS4Base", baseType: !8) +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !9 = !{!10} -!10 = !{!"0x2e\00f\00f\00_Z1fi\003\000\001\000\006\00256\000\003", !1, !11, !12, null, void (i32)* @_Z1fi, null, null, !2} ; [ DW_TAG_subprogram ] [line 3] [def] [f] -!11 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/Users/mren/c_testing/type_unique_air/simple/foo.cpp] -!12 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !13, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!10 = !MDSubprogram(name: "f", linkageName: "_Z1fi", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !11, type: !12, function: void (i32)* @_Z1fi, variables: !2) +!11 = !MDFile(filename: "foo.cpp", directory: "/Users/mren/c_testing/type_unique_air/simple") +!12 = !MDSubroutineType(types: !13) !13 = !{null, !8} !14 = !{i32 2, !"Dwarf Version", i32 2} -!15 = !{!"0x101\00a\0016777219\000", !10, !11, !8} ; [ DW_TAG_arg_variable ] [a] [line 3] +!15 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 3, arg: 1, scope: !10, file: !11, type: !8) !16 = !MDLocation(line: 3, scope: !10) -!17 = !{!"0x100\00t\004\000", !10, !11, !4} ; [ DW_TAG_auto_variable ] [t] [line 4] +!17 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "t", line: 4, scope: !10, file: !11, type: !4) !18 = !MDLocation(line: 4, scope: !10) !19 = !MDLocation(line: 5, scope: !10) -!20 = !{i32 1, !"Debug Info Version", i32 2} +!20 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Linker/type-unique-simple-b.ll b/test/Linker/type-unique-simple-b.ll index fb1a529..4cbfc8a 100644 --- a/test/Linker/type-unique-simple-b.ll +++ b/test/Linker/type-unique-simple-b.ll @@ -10,8 +10,8 @@ entry: %a.addr = alloca i32, align 4 %t = alloca %struct.Base, align 4 store i32 %a, i32* %a.addr, align 4 - call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !18, metadata !{!"0x102"}), !dbg !19 - call void @llvm.dbg.declare(metadata %struct.Base* %t, metadata !20, metadata !{!"0x102"}), !dbg !21 + call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !18, metadata !MDExpression()), !dbg !19 + call void @llvm.dbg.declare(metadata %struct.Base* %t, metadata !20, metadata !MDExpression()), !dbg !21 ret void, !dbg !22 } @@ -38,30 +38,30 @@ attributes #3 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!17, !26} -!0 = !{!"0x11\004\00clang version 3.4 (http://llvm.org/git/clang.git c23b1db6268c8e7ce64026d57d1510c1aac200a0) (http://llvm.org/git/llvm.git 09b98fe3978eddefc2145adc1056cf21580ce945)\000\00\000\00\000", !1, !2, !3, !9, !2, !2} ; [ DW_TAG_compile_unit ] [/Users/mren/c_testing/type_unique_air/simple/bar.cpp] [DW_LANG_C_plus_plus] -!1 = !{!"bar.cpp", !"/Users/mren/c_testing/type_unique_air/simple"} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (http://llvm.org/git/clang.git c23b1db6268c8e7ce64026d57d1510c1aac200a0) (http://llvm.org/git/llvm.git 09b98fe3978eddefc2145adc1056cf21580ce945)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !9, globals: !2, imports: !2) +!1 = !MDFile(filename: "bar.cpp", directory: "/Users/mren/c_testing/type_unique_air/simple") !2 = !{} !3 = !{!4} -!4 = !{!"0x13\00Base\001\0032\0032\000\000\000", !5, null, null, !6, null, null, !"_ZTS4Base"} ; [ DW_TAG_structure_type ] [Base] [line 1, size 32, align 32, offset 0] [def] [from ] -!5 = !{!"./a.hpp", !"/Users/mren/c_testing/type_unique_air/simple"} +!4 = !MDCompositeType(tag: DW_TAG_structure_type, name: "Base", line: 1, size: 32, align: 32, file: !5, elements: !6, identifier: "_ZTS4Base") +!5 = !MDFile(filename: "./a.hpp", directory: "/Users/mren/c_testing/type_unique_air/simple") !6 = !{!7} -!7 = !{!"0xd\00a\002\0032\0032\000\000", !5, !"_ZTS4Base", !8} ; [ DW_TAG_member ] [a] [line 2, size 32, align 32, offset 0] [from int] -!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] +!7 = !MDDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, file: !5, scope: !"_ZTS4Base", baseType: !8) +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !9 = !{!10, !14} -!10 = !{!"0x2e\00g\00g\00_Z1gi\004\000\001\000\006\00256\000\004", !1, !11, !12, null, void (i32)* @_Z1gi, null, null, !2} ; [ DW_TAG_subprogram ] [line 4] [def] [g] -!11 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/Users/mren/c_testing/type_unique_air/simple/bar.cpp] -!12 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !13, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!10 = !MDSubprogram(name: "g", linkageName: "_Z1gi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !11, type: !12, function: void (i32)* @_Z1gi, variables: !2) +!11 = !MDFile(filename: "bar.cpp", directory: "/Users/mren/c_testing/type_unique_air/simple") +!12 = !MDSubroutineType(types: !13) !13 = !{null, !8} -!14 = !{!"0x2e\00main\00main\00\007\000\001\000\006\00256\000\007", !1, !11, !15, null, i32 ()* @main, null, null, !2} ; [ DW_TAG_subprogram ] [line 7] [def] [main] -!15 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !16, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!14 = !MDSubprogram(name: "main", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !11, type: !15, function: i32 ()* @main, variables: !2) +!15 = !MDSubroutineType(types: !16) !16 = !{!8} !17 = !{i32 2, !"Dwarf Version", i32 2} -!18 = !{!"0x101\00a\0016777220\000", !10, !11, !8} ; [ DW_TAG_arg_variable ] [a] [line 4] +!18 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 4, arg: 1, scope: !10, file: !11, type: !8) !19 = !MDLocation(line: 4, scope: !10) -!20 = !{!"0x100\00t\005\000", !10, !11, !4} ; [ DW_TAG_auto_variable ] [t] [line 5] +!20 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "t", line: 5, scope: !10, file: !11, type: !4) !21 = !MDLocation(line: 5, scope: !10) !22 = !MDLocation(line: 6, scope: !10) !23 = !MDLocation(line: 8, scope: !14) !24 = !MDLocation(line: 9, scope: !14) !25 = !MDLocation(line: 10, scope: !14) -!26 = !{i32 1, !"Debug Info Version", i32 2} +!26 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Linker/type-unique-simple2-a.ll b/test/Linker/type-unique-simple2-a.ll index 72a776b..ed53601 100644 --- a/test/Linker/type-unique-simple2-a.ll +++ b/test/Linker/type-unique-simple2-a.ll @@ -48,8 +48,8 @@ define linkonce_odr void @_ZN1AC1Ev(%class.A* %this) unnamed_addr #2 align 2 { entry: %this.addr = alloca %class.A*, align 8 store %class.A* %this, %class.A** %this.addr, align 8 - call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !39, metadata !{!"0x102"}), !dbg !41 - %this1 = load %class.A** %this.addr + call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !39, metadata !MDExpression()), !dbg !41 + %this1 = load %class.A*, %class.A** %this.addr call void @_ZN1AC2Ev(%class.A* %this1) #1, !dbg !42 ret void, !dbg !42 } @@ -64,10 +64,10 @@ define linkonce_odr void @_ZN1AC2Ev(%class.A* %this) unnamed_addr #2 align 2 { entry: %this.addr = alloca %class.A*, align 8 store %class.A* %this, %class.A** %this.addr, align 8 - call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !44, metadata !{!"0x102"}), !dbg !45 - %this1 = load %class.A** %this.addr + call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !44, metadata !MDExpression()), !dbg !45 + %this1 = load %class.A*, %class.A** %this.addr %0 = bitcast %class.A* %this1 to i8***, !dbg !46 - store i8** getelementptr inbounds ([4 x i8*]* @_ZTV1A, i64 0, i64 2), i8*** %0, !dbg !46 + store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @_ZTV1A, i64 0, i64 2), i8*** %0, !dbg !46 ret void, !dbg !46 } @@ -80,50 +80,50 @@ attributes #4 = { nounwind readnone } !llvm.module.flags = !{!35, !36} !llvm.ident = !{!37} -!0 = !{!"0x11\004\00clang version 3.5 \000\00\000\00\000", !1, !2, !3, !26, !2, !2} ; [ DW_TAG_compile_unit ] [/<unknown>] [DW_LANG_C_plus_plus] -!1 = !{!"<unknown>", !""} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !26, globals: !2, imports: !2) +!1 = !MDFile(filename: "<unknown>", directory: "") !2 = !{} !3 = !{!4} -!4 = !{!"0x2\00A\002\0064\0064\000\000\000", !5, null, null, !6, !"_ZTS1A", null, !"_ZTS1A"} ; [ DW_TAG_class_type ] [A] [line 2, size 64, align 64, offset 0] [def] [from ] -!5 = !{!"./ab.h", !""} +!4 = !MDCompositeType(tag: DW_TAG_class_type, name: "A", line: 2, size: 64, align: 64, file: !5, elements: !6, vtableHolder: !"_ZTS1A", identifier: "_ZTS1A") +!5 = !MDFile(filename: "./ab.h", directory: "") !6 = !{!7, !14, !19} -!7 = !{!"0xd\00_vptr$A\000\0064\000\000\0064", !5, !8, !9} ; [ DW_TAG_member ] [_vptr$A] [line 0, size 64, align 0, offset 0] [artificial] [from ] -!8 = !{!"0x29", !5} ; [ DW_TAG_file_type ] [/./ab.h] -!9 = !{!"0xf\00\000\0064\000\000\000", null, null, !10} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 0, offset 0] [from __vtbl_ptr_type] -!10 = !{!"0xf\00__vtbl_ptr_type\000\0064\000\000\000", null, null, !11} ; [ DW_TAG_pointer_type ] [__vtbl_ptr_type] [line 0, size 64, align 0, offset 0] [from ] -!11 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !12, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!7 = !MDDerivedType(tag: DW_TAG_member, name: "_vptr$A", size: 64, flags: DIFlagArtificial, file: !5, scope: !8, baseType: !9) +!8 = !MDFile(filename: "./ab.h", directory: "") +!9 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, baseType: !10) +!10 = !MDDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", size: 64, baseType: !11) +!11 = !MDSubroutineType(types: !12) !12 = !{!13} -!13 = !{!"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] -!14 = !{!"0x2e\00setFoo\00setFoo\00_ZN1A6setFooEv\004\000\000\001\006\00259\000\004", !5, !"_ZTS1A", !15, !"_ZTS1A", null, null, i32 0, !18} ; [ DW_TAG_subprogram ] [line 4] [setFoo] -!15 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !16, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!13 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!14 = !MDSubprogram(name: "setFoo", linkageName: "_ZN1A6setFooEv", line: 4, isLocal: false, isDefinition: false, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 6, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !5, scope: !"_ZTS1A", type: !15, containingType: !"_ZTS1A", variables: !18) +!15 = !MDSubroutineType(types: !16) !16 = !{null, !17} -!17 = !{!"0xf\00\000\0064\0064\000\001088", null, null, !"_ZTS1A"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS1A] +!17 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") !18 = !{i32 786468} -!19 = !{!"0x2e\00getFoo\00getFoo\00_ZN1A6getFooEv\005\000\000\001\006\00259\000\005", !5, !"_ZTS1A", !20, !"_ZTS1A", null, null, i32 0, !25} ; [ DW_TAG_subprogram ] [line 5] [getFoo] -!20 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !21, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!19 = !MDSubprogram(name: "getFoo", linkageName: "_ZN1A6getFooEv", line: 5, isLocal: false, isDefinition: false, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 6, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !5, scope: !"_ZTS1A", type: !20, containingType: !"_ZTS1A", variables: !25) +!20 = !MDSubroutineType(types: !21) !21 = !{!22, !17} -!22 = !{!"0x26\00\000\000\000\000\000", null, null, !23} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from foo_t] -!23 = !{!"0x16\00foo_t\001\000\000\000\000", !24, null, !13} ; [ DW_TAG_typedef ] [foo_t] [line 1, size 0, align 0, offset 0] [from int] -!24 = !{!"a.cpp", !""} +!22 = !MDDerivedType(tag: DW_TAG_const_type, baseType: !23) +!23 = !MDDerivedType(tag: DW_TAG_typedef, name: "foo_t", line: 1, file: !24, baseType: !13) +!24 = !MDFile(filename: "a.cpp", directory: "") !25 = !{i32 786468} !26 = !{!27, !31, !34} -!27 = !{!"0x2e\00bar\00bar\00_Z3barv\002\000\001\000\006\00256\000\002", !24, !28, !29, null, i32 ()* @_Z3barv, null, null, !2} ; [ DW_TAG_subprogram ] [line 2] [def] [bar] -!28 = !{!"0x29", !24} ; [ DW_TAG_file_type ] [/a.cpp] -!29 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !30, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!27 = !MDSubprogram(name: "bar", linkageName: "_Z3barv", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !24, scope: !28, type: !29, function: i32 ()* @_Z3barv, variables: !2) +!28 = !MDFile(filename: "a.cpp", directory: "") +!29 = !MDSubroutineType(types: !30) !30 = !{!23} -!31 = !{!"0x2e\00A\00A\00_ZN1AC1Ev\002\000\001\000\006\00320\000\002", !5, !"_ZTS1A", !15, null, void (%class.A*)* @_ZN1AC1Ev, null, !32, !2} ; [ DW_TAG_subprogram ] [line 2] [def] [A] -!32 = !{!"0x2e\00A\00A\00\000\000\000\000\006\00320\000\000", null, !"_ZTS1A", !15, null, null, null, i32 0, !33} ; [ DW_TAG_subprogram ] [line 0] [A] +!31 = !MDSubprogram(name: "A", linkageName: "_ZN1AC1Ev", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !5, scope: !"_ZTS1A", type: !15, function: void (%class.A*)* @_ZN1AC1Ev, declaration: !32, variables: !2) +!32 = !MDSubprogram(name: "A", isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scope: !"_ZTS1A", type: !15, variables: !33) !33 = !{i32 786468} -!34 = !{!"0x2e\00A\00A\00_ZN1AC2Ev\002\000\001\000\006\00320\000\002", !5, !"_ZTS1A", !15, null, void (%class.A*)* @_ZN1AC2Ev, null, !32, !2} ; [ DW_TAG_subprogram ] [line 2] [def] [A] +!34 = !MDSubprogram(name: "A", linkageName: "_ZN1AC2Ev", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !5, scope: !"_ZTS1A", type: !15, function: void (%class.A*)* @_ZN1AC2Ev, declaration: !32, variables: !2) !35 = !{i32 2, !"Dwarf Version", i32 2} -!36 = !{i32 1, !"Debug Info Version", i32 2} +!36 = !{i32 1, !"Debug Info Version", i32 3} !37 = !{!"clang version 3.5 "} !38 = !MDLocation(line: 3, scope: !27) -!39 = !{!"0x101\00this\0016777216\001088", !31, null, !40} ; [ DW_TAG_arg_variable ] [this] [line 0] -!40 = !{!"0xf\00\000\0064\0064\000\000", null, null, !"_ZTS1A"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from _ZTS1A] +!39 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !31, type: !40) +!40 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1A") !41 = !MDLocation(line: 0, scope: !31) !42 = !MDLocation(line: 2, scope: !43) -!43 = !{!"0xb\000", !5, !31} ; [ DW_TAG_lexical_block ] [/./ab.h] -!44 = !{!"0x101\00this\0016777216\001088", !34, null, !40} ; [ DW_TAG_arg_variable ] [this] [line 0] +!43 = !MDLexicalBlockFile(discriminator: 0, file: !5, scope: !31) +!44 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !34, type: !40) !45 = !MDLocation(line: 0, scope: !34) !46 = !MDLocation(line: 2, scope: !34) diff --git a/test/Linker/type-unique-simple2-b.ll b/test/Linker/type-unique-simple2-b.ll index 25e67d4..884995b 100644 --- a/test/Linker/type-unique-simple2-b.ll +++ b/test/Linker/type-unique-simple2-b.ll @@ -15,15 +15,15 @@ @_ZTV1A = unnamed_addr constant [4 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_ZTI1A to i8*), i8* bitcast (void (%class.A*)* @_ZN1A6setFooEv to i8*), i8* bitcast (i32 (%class.A*)* @_ZN1A6getFooEv to i8*)] @_ZTVN10__cxxabiv117__class_type_infoE = external global i8* @_ZTS1A = constant [3 x i8] c"1A\00" -@_ZTI1A = unnamed_addr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8]* @_ZTS1A, i32 0, i32 0) } +@_ZTI1A = unnamed_addr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1A, i32 0, i32 0) } ; Function Attrs: nounwind define void @_ZN1A6setFooEv(%class.A* %this) unnamed_addr #0 align 2 { entry: %this.addr = alloca %class.A*, align 8 store %class.A* %this, %class.A** %this.addr, align 8 - call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !32, metadata !{!"0x102"}), !dbg !34 - %this1 = load %class.A** %this.addr + call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !32, metadata !MDExpression()), !dbg !34 + %this1 = load %class.A*, %class.A** %this.addr ret void, !dbg !35 } @@ -35,8 +35,8 @@ define i32 @_ZN1A6getFooEv(%class.A* %this) unnamed_addr #0 align 2 { entry: %this.addr = alloca %class.A*, align 8 store %class.A* %this, %class.A** %this.addr, align 8 - call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !36, metadata !{!"0x102"}), !dbg !37 - %this1 = load %class.A** %this.addr + call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !36, metadata !MDExpression()), !dbg !37 + %this1 = load %class.A*, %class.A** %this.addr ret i32 1, !dbg !38 } @@ -47,42 +47,42 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!29, !30} !llvm.ident = !{!31} -!0 = !{!"0x11\004\00clang version 3.5 \000\00\000\00\000", !1, !2, !3, !25, !2, !2} ; [ DW_TAG_compile_unit ] [/<unknown>] [DW_LANG_C_plus_plus] -!1 = !{!"<unknown>", !""} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !25, globals: !2, imports: !2) +!1 = !MDFile(filename: "<unknown>", directory: "") !2 = !{} !3 = !{!4} -!4 = !{!"0x2\00A\002\0064\0064\000\000\000", !5, null, null, !6, !"_ZTS1A", null, !"_ZTS1A"} ; [ DW_TAG_class_type ] [A] [line 2, size 64, align 64, offset 0] [def] [from ] -!5 = !{!"./ab.h", !""} +!4 = !MDCompositeType(tag: DW_TAG_class_type, name: "A", line: 2, size: 64, align: 64, file: !5, elements: !6, vtableHolder: !"_ZTS1A", identifier: "_ZTS1A") +!5 = !MDFile(filename: "./ab.h", directory: "") !6 = !{!7, !14, !19} -!7 = !{!"0xd\00_vptr$A\000\0064\000\000\0064", !5, !8, !9} ; [ DW_TAG_member ] [_vptr$A] [line 0, size 64, align 0, offset 0] [artificial] [from ] -!8 = !{!"0x29", !5} ; [ DW_TAG_file_type ] [/./ab.h] -!9 = !{!"0xf\00\000\0064\000\000\000", null, null, !10} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 0, offset 0] [from __vtbl_ptr_type] -!10 = !{!"0xf\00__vtbl_ptr_type\000\0064\000\000\000", null, null, !11} ; [ DW_TAG_pointer_type ] [__vtbl_ptr_type] [line 0, size 64, align 0, offset 0] [from ] -!11 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !12, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!7 = !MDDerivedType(tag: DW_TAG_member, name: "_vptr$A", size: 64, flags: DIFlagArtificial, file: !5, scope: !8, baseType: !9) +!8 = !MDFile(filename: "./ab.h", directory: "") +!9 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, baseType: !10) +!10 = !MDDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", size: 64, baseType: !11) +!11 = !MDSubroutineType(types: !12) !12 = !{!13} -!13 = !{!"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] -!14 = !{!"0x2e\00setFoo\00setFoo\00_ZN1A6setFooEv\004\000\000\001\006\00259\000\004", !5, !"_ZTS1A", !15, !"_ZTS1A", null, null, i32 0, !18} ; [ DW_TAG_subprogram ] [line 4] [setFoo] -!15 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !16, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!13 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!14 = !MDSubprogram(name: "setFoo", linkageName: "_ZN1A6setFooEv", line: 4, isLocal: false, isDefinition: false, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 6, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !5, scope: !"_ZTS1A", type: !15, containingType: !"_ZTS1A", variables: !18) +!15 = !MDSubroutineType(types: !16) !16 = !{null, !17} -!17 = !{!"0xf\00\000\0064\0064\000\001088", null, null, !"_ZTS1A"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS1A] +!17 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") !18 = !{i32 786468} -!19 = !{!"0x2e\00getFoo\00getFoo\00_ZN1A6getFooEv\005\000\000\001\006\00259\000\005", !5, !"_ZTS1A", !20, !"_ZTS1A", null, null, i32 0, !24} ; [ DW_TAG_subprogram ] [line 5] [getFoo] -!20 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !21, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!19 = !MDSubprogram(name: "getFoo", linkageName: "_ZN1A6getFooEv", line: 5, isLocal: false, isDefinition: false, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 6, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !5, scope: !"_ZTS1A", type: !20, containingType: !"_ZTS1A", variables: !24) +!20 = !MDSubroutineType(types: !21) !21 = !{!22, !17} -!22 = !{!"0x26\00\000\000\000\000\000", null, null, !23} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from foo_t] -!23 = !{!"0x16\00foo_t\001\000\000\000\000", !5, null, !13} ; [ DW_TAG_typedef ] [foo_t] [line 1, size 0, align 0, offset 0] [from int] +!22 = !MDDerivedType(tag: DW_TAG_const_type, baseType: !23) +!23 = !MDDerivedType(tag: DW_TAG_typedef, name: "foo_t", line: 1, file: !5, baseType: !13) !24 = !{i32 786468} !25 = !{!26, !28} -!26 = !{!"0x2e\00setFoo\00setFoo\00_ZN1A6setFooEv\002\000\001\000\006\00259\000\002", !27, !"_ZTS1A", !15, null, void (%class.A*)* @_ZN1A6setFooEv, null, !14, !2} ; [ DW_TAG_subprogram ] [line 2] [def] [setFoo] -!27 = !{!"b.cpp", !""} -!28 = !{!"0x2e\00getFoo\00getFoo\00_ZN1A6getFooEv\004\000\001\000\006\00259\000\004", !27, !"_ZTS1A", !20, null, i32 (%class.A*)* @_ZN1A6getFooEv, null, !19, !2} ; [ DW_TAG_subprogram ] [line 4] [def] [getFoo] +!26 = !MDSubprogram(name: "setFoo", linkageName: "_ZN1A6setFooEv", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !27, scope: !"_ZTS1A", type: !15, function: void (%class.A*)* @_ZN1A6setFooEv, declaration: !14, variables: !2) +!27 = !MDFile(filename: "b.cpp", directory: "") +!28 = !MDSubprogram(name: "getFoo", linkageName: "_ZN1A6getFooEv", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !27, scope: !"_ZTS1A", type: !20, function: i32 (%class.A*)* @_ZN1A6getFooEv, declaration: !19, variables: !2) !29 = !{i32 2, !"Dwarf Version", i32 2} -!30 = !{i32 1, !"Debug Info Version", i32 2} +!30 = !{i32 1, !"Debug Info Version", i32 3} !31 = !{!"clang version 3.5 "} -!32 = !{!"0x101\00this\0016777216\001088", !26, null, !33} ; [ DW_TAG_arg_variable ] [this] [line 0] -!33 = !{!"0xf\00\000\0064\0064\000\000", null, null, !"_ZTS1A"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from _ZTS1A] +!32 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !26, type: !33) +!33 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1A") !34 = !MDLocation(line: 0, scope: !26) !35 = !MDLocation(line: 2, scope: !26) -!36 = !{!"0x101\00this\0016777216\001088", !28, null, !33} ; [ DW_TAG_arg_variable ] [this] [line 0] +!36 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !28, type: !33) !37 = !MDLocation(line: 0, scope: !28) !38 = !MDLocation(line: 4, scope: !28) diff --git a/test/Linker/type-unique-src-type.ll b/test/Linker/type-unique-src-type.ll index 01b33a2..110ecc8 100644 --- a/test/Linker/type-unique-src-type.ll +++ b/test/Linker/type-unique-src-type.ll @@ -11,14 +11,14 @@ ; CHECK-NEXT: %A = type { i8 } ; CHECK: @g1 = external global %C.0 -; CHECK: getelementptr %C.0* null, i64 0, i32 0, i32 0 +; CHECK: getelementptr %C.0, %C.0* null, i64 0, i32 0, i32 0 %A = type { i8 } %B = type { %A } %C = type { %B } %C.0 = type { %B } define void @f1() { - getelementptr %C* null, i64 0, i32 0, i32 0 + getelementptr %C, %C* null, i64 0, i32 0, i32 0 ret void } @g1 = external global %C.0 diff --git a/test/Linker/type-unique-type-array-a.ll b/test/Linker/type-unique-type-array-a.ll index 9e2de88..a2b1316 100644 --- a/test/Linker/type-unique-type-array-a.ll +++ b/test/Linker/type-unique-type-array-a.ll @@ -48,17 +48,17 @@ entry: %sa = alloca %struct.SA, align 4 %a.addr = alloca %class.A*, align 8 %agg.tmp = alloca %struct.SA, align 4 - %coerce.dive = getelementptr %struct.SA* %sa, i32 0, i32 0 + %coerce.dive = getelementptr %struct.SA, %struct.SA* %sa, i32 0, i32 0 store i32 %sa.coerce, i32* %coerce.dive store %class.A* %a, %class.A** %a.addr, align 8 - call void @llvm.dbg.declare(metadata %class.A** %a.addr, metadata !24, metadata !{!"0x102"}), !dbg !25 - call void @llvm.dbg.declare(metadata %struct.SA* %sa, metadata !26, metadata !{!"0x102"}), !dbg !27 - %0 = load %class.A** %a.addr, align 8, !dbg !28 + call void @llvm.dbg.declare(metadata %class.A** %a.addr, metadata !24, metadata !MDExpression()), !dbg !25 + call void @llvm.dbg.declare(metadata %struct.SA* %sa, metadata !26, metadata !MDExpression()), !dbg !27 + %0 = load %class.A*, %class.A** %a.addr, align 8, !dbg !28 %1 = bitcast %struct.SA* %agg.tmp to i8*, !dbg !28 %2 = bitcast %struct.SA* %sa to i8*, !dbg !28 call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 4, i32 4, i1 false), !dbg !28 - %coerce.dive1 = getelementptr %struct.SA* %agg.tmp, i32 0, i32 0, !dbg !28 - %3 = load i32* %coerce.dive1, !dbg !28 + %coerce.dive1 = getelementptr %struct.SA, %struct.SA* %agg.tmp, i32 0, i32 0, !dbg !28 + %3 = load i32, i32* %coerce.dive1, !dbg !28 call void @_ZN1A5testAE2SA(%class.A* %0, i32 %3), !dbg !28 ret void, !dbg !29 } @@ -71,12 +71,12 @@ define linkonce_odr void @_ZN1A5testAE2SA(%class.A* %this, i32 %a.coerce) #2 ali entry: %a = alloca %struct.SA, align 4 %this.addr = alloca %class.A*, align 8 - %coerce.dive = getelementptr %struct.SA* %a, i32 0, i32 0 + %coerce.dive = getelementptr %struct.SA, %struct.SA* %a, i32 0, i32 0 store i32 %a.coerce, i32* %coerce.dive store %class.A* %this, %class.A** %this.addr, align 8 - call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !30, metadata !{!"0x102"}), !dbg !31 - call void @llvm.dbg.declare(metadata %struct.SA* %a, metadata !32, metadata !{!"0x102"}), !dbg !33 - %this1 = load %class.A** %this.addr + call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !30, metadata !MDExpression()), !dbg !31 + call void @llvm.dbg.declare(metadata %struct.SA* %a, metadata !32, metadata !MDExpression()), !dbg !33 + %this1 = load %class.A*, %class.A** %this.addr ret void, !dbg !34 } @@ -92,38 +92,38 @@ attributes #3 = { nounwind } !llvm.module.flags = !{!21, !22} !llvm.ident = !{!23} -!0 = !{!"0x11\004\00clang version 3.5.0 (trunk 214102:214113M) (llvm/trunk 214102:214115M)\000\00\000\00\001", !1, !2, !3, !14, !2, !2} ; [ DW_TAG_compile_unit ] [a.cpp] [DW_LANG_C_plus_plus] -!1 = !{!"a.cpp", !"/Users/manmanren/test-Nov/type_unique/rdar_di_array"} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 214102:214113M) (llvm/trunk 214102:214115M)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !14, globals: !2, imports: !2) +!1 = !MDFile(filename: "a.cpp", directory: "/Users/manmanren/test-Nov/type_unique/rdar_di_array") !2 = !{} !3 = !{!4, !10} -!4 = !{!"0x2\00A\005\008\008\000\000\000", !1, null, null, !5, null, null, !"_ZTS1A"} ; [ DW_TAG_class_type ] [A] [line 5, size 8, align 8, offset 0] [def] [from ] +!4 = !MDCompositeType(tag: DW_TAG_class_type, name: "A", line: 5, size: 8, align: 8, file: !1, elements: !5, identifier: "_ZTS1A") !5 = !{!6} -!6 = !{!"0x2e\00testA\00testA\00_ZN1A5testAE2SA\007\000\000\000\006\00256\000\007", !1, !"_ZTS1A", !7, null, null, null, i32 0, null} ; [ DW_TAG_subprogram ] [line 7] [testA] -!7 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!6 = !MDSubprogram(name: "testA", linkageName: "_ZN1A5testAE2SA", line: 7, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !"_ZTS1A", type: !7) +!7 = !MDSubroutineType(types: !8) !8 = !{null, !9, !"_ZTS2SA"} -!9 = !{!"0xf\00\000\0064\0064\000\001088", null, null, !"_ZTS1A"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS1A] -!10 = !{!"0x13\00SA\001\0032\0032\000\000\000", !1, null, null, !11, null, null, !"_ZTS2SA"} ; [ DW_TAG_structure_type ] [SA] [line 1, size 32, align 32, offset 0] [def] [from ] +!9 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") +!10 = !MDCompositeType(tag: DW_TAG_structure_type, name: "SA", line: 1, size: 32, align: 32, file: !1, elements: !11, identifier: "_ZTS2SA") !11 = !{!12} -!12 = !{!"0xd\00a\002\0032\0032\000\000", !1, !"_ZTS2SA", !13} ; [ DW_TAG_member ] [a] [line 2, size 32, align 32, offset 0] [from int] -!13 = !{!"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] +!12 = !MDDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, file: !1, scope: !"_ZTS2SA", baseType: !13) +!13 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !14 = !{!15, !20} -!15 = !{!"0x2e\00topA\00topA\00_Z4topAP1A2SA\0011\000\001\000\006\00256\000\0011", !1, !16, !17, null, void (%class.A*, i32)* @_Z4topAP1A2SA, null, null, !2} ; [ DW_TAG_subprogram ] [line 11] [def] [topA] -!16 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [a.cpp] -!17 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !18, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!15 = !MDSubprogram(name: "topA", linkageName: "_Z4topAP1A2SA", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 11, file: !1, scope: !16, type: !17, function: void (%class.A*, i32)* @_Z4topAP1A2SA, variables: !2) +!16 = !MDFile(filename: "a.cpp", directory: "/Users/manmanren/test-Nov/type_unique/rdar_di_array") +!17 = !MDSubroutineType(types: !18) !18 = !{null, !19, !"_ZTS2SA"} -!19 = !{!"0xf\00\000\0064\0064\000\000", null, null, !"_ZTS1A"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from _ZTS1A] -!20 = !{!"0x2e\00testA\00testA\00_ZN1A5testAE2SA\007\000\001\000\006\00256\000\007", !1, !"_ZTS1A", !7, null, void (%class.A*, i32)* @_ZN1A5testAE2SA, null, !6, !2} ; [ DW_TAG_subprogram ] [line 7] [def] [testA] +!19 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1A") +!20 = !MDSubprogram(name: "testA", linkageName: "_ZN1A5testAE2SA", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !"_ZTS1A", type: !7, function: void (%class.A*, i32)* @_ZN1A5testAE2SA, declaration: !6, variables: !2) !21 = !{i32 2, !"Dwarf Version", i32 2} -!22 = !{i32 2, !"Debug Info Version", i32 2} +!22 = !{i32 2, !"Debug Info Version", i32 3} !23 = !{!"clang version 3.5.0 (trunk 214102:214113M) (llvm/trunk 214102:214115M)"} -!24 = !{!"0x101\00a\0016777227\000", !15, !16, !19} ; [ DW_TAG_arg_variable ] [a] [line 11] +!24 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 11, arg: 1, scope: !15, file: !16, type: !19) !25 = !MDLocation(line: 11, column: 14, scope: !15) -!26 = !{!"0x101\00sa\0033554443\000", !15, !16, !"_ZTS2SA"} ; [ DW_TAG_arg_variable ] [sa] [line 11] +!26 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "sa", line: 11, arg: 2, scope: !15, file: !16, type: !"_ZTS2SA") !27 = !MDLocation(line: 11, column: 20, scope: !15) !28 = !MDLocation(line: 12, column: 3, scope: !15) !29 = !MDLocation(line: 13, column: 1, scope: !15) -!30 = !{!"0x101\00this\0016777216\001088", !20, null, !19} ; [ DW_TAG_arg_variable ] [this] [line 0] +!30 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !20, type: !19) !31 = !MDLocation(line: 0, scope: !20) -!32 = !{!"0x101\00a\0033554439\000", !20, !16, !"_ZTS2SA"} ; [ DW_TAG_arg_variable ] [a] [line 7] +!32 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 7, arg: 2, scope: !20, file: !16, type: !"_ZTS2SA") !33 = !MDLocation(line: 7, column: 17, scope: !20) !34 = !MDLocation(line: 8, column: 3, scope: !20) diff --git a/test/Linker/type-unique-type-array-b.ll b/test/Linker/type-unique-type-array-b.ll index 0fdae2a..11b0a20 100644 --- a/test/Linker/type-unique-type-array-b.ll +++ b/test/Linker/type-unique-type-array-b.ll @@ -27,17 +27,17 @@ entry: %sa = alloca %struct.SA, align 4 %b.addr = alloca %class.B*, align 8 %agg.tmp = alloca %struct.SA, align 4 - %coerce.dive = getelementptr %struct.SA* %sa, i32 0, i32 0 + %coerce.dive = getelementptr %struct.SA, %struct.SA* %sa, i32 0, i32 0 store i32 %sa.coerce, i32* %coerce.dive store %class.B* %b, %class.B** %b.addr, align 8 - call void @llvm.dbg.declare(metadata %class.B** %b.addr, metadata !24, metadata !{!"0x102"}), !dbg !25 - call void @llvm.dbg.declare(metadata %struct.SA* %sa, metadata !26, metadata !{!"0x102"}), !dbg !27 - %0 = load %class.B** %b.addr, align 8, !dbg !28 + call void @llvm.dbg.declare(metadata %class.B** %b.addr, metadata !24, metadata !MDExpression()), !dbg !25 + call void @llvm.dbg.declare(metadata %struct.SA* %sa, metadata !26, metadata !MDExpression()), !dbg !27 + %0 = load %class.B*, %class.B** %b.addr, align 8, !dbg !28 %1 = bitcast %struct.SA* %agg.tmp to i8*, !dbg !28 %2 = bitcast %struct.SA* %sa to i8*, !dbg !28 call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 4, i32 4, i1 false), !dbg !28 - %coerce.dive1 = getelementptr %struct.SA* %agg.tmp, i32 0, i32 0, !dbg !28 - %3 = load i32* %coerce.dive1, !dbg !28 + %coerce.dive1 = getelementptr %struct.SA, %struct.SA* %agg.tmp, i32 0, i32 0, !dbg !28 + %3 = load i32, i32* %coerce.dive1, !dbg !28 call void @_ZN1B5testBE2SA(%class.B* %0, i32 %3), !dbg !28 ret void, !dbg !29 } @@ -50,12 +50,12 @@ define linkonce_odr void @_ZN1B5testBE2SA(%class.B* %this, i32 %sa.coerce) #2 al entry: %sa = alloca %struct.SA, align 4 %this.addr = alloca %class.B*, align 8 - %coerce.dive = getelementptr %struct.SA* %sa, i32 0, i32 0 + %coerce.dive = getelementptr %struct.SA, %struct.SA* %sa, i32 0, i32 0 store i32 %sa.coerce, i32* %coerce.dive store %class.B* %this, %class.B** %this.addr, align 8 - call void @llvm.dbg.declare(metadata %class.B** %this.addr, metadata !30, metadata !{!"0x102"}), !dbg !31 - call void @llvm.dbg.declare(metadata %struct.SA* %sa, metadata !32, metadata !{!"0x102"}), !dbg !33 - %this1 = load %class.B** %this.addr + call void @llvm.dbg.declare(metadata %class.B** %this.addr, metadata !30, metadata !MDExpression()), !dbg !31 + call void @llvm.dbg.declare(metadata %struct.SA* %sa, metadata !32, metadata !MDExpression()), !dbg !33 + %this1 = load %class.B*, %class.B** %this.addr ret void, !dbg !34 } @@ -71,38 +71,38 @@ attributes #3 = { nounwind } !llvm.module.flags = !{!21, !22} !llvm.ident = !{!23} -!0 = !{!"0x11\004\00clang version 3.5.0 (trunk 214102:214113M) (llvm/trunk 214102:214115M)\000\00\000\00\001", !1, !2, !3, !14, !2, !2} ; [ DW_TAG_compile_unit ] [b.cpp] [DW_LANG_C_plus_plus] -!1 = !{!"b.cpp", !"/Users/manmanren/test-Nov/type_unique/rdar_di_array"} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 214102:214113M) (llvm/trunk 214102:214115M)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !14, globals: !2, imports: !2) +!1 = !MDFile(filename: "b.cpp", directory: "/Users/manmanren/test-Nov/type_unique/rdar_di_array") !2 = !{} !3 = !{!4, !10} -!4 = !{!"0x2\00B\005\008\008\000\000\000", !1, null, null, !5, null, null, !"_ZTS1B"} ; [ DW_TAG_class_type ] [B] [line 5, size 8, align 8, offset 0] [def] [from ] +!4 = !MDCompositeType(tag: DW_TAG_class_type, name: "B", line: 5, size: 8, align: 8, file: !1, elements: !5, identifier: "_ZTS1B") !5 = !{!6} -!6 = !{!"0x2e\00testB\00testB\00_ZN1B5testBE2SA\007\000\000\000\006\00256\000\007", !1, !"_ZTS1B", !7, null, null, null, i32 0, null} ; [ DW_TAG_subprogram ] [line 7] [testB] -!7 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!6 = !MDSubprogram(name: "testB", linkageName: "_ZN1B5testBE2SA", line: 7, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !"_ZTS1B", type: !7) +!7 = !MDSubroutineType(types: !8) !8 = !{null, !9, !"_ZTS2SA"} -!9 = !{!"0xf\00\000\0064\0064\000\001088", null, null, !"_ZTS1B"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS1B] -!10 = !{!"0x13\00SA\001\0032\0032\000\000\000", !1, null, null, !11, null, null, !"_ZTS2SA"} ; [ DW_TAG_structure_type ] [SA] [line 1, size 32, align 32, offset 0] [def] [from ] +!9 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1B") +!10 = !MDCompositeType(tag: DW_TAG_structure_type, name: "SA", line: 1, size: 32, align: 32, file: !1, elements: !11, identifier: "_ZTS2SA") !11 = !{!12} -!12 = !{!"0xd\00a\002\0032\0032\000\000", !1, !"_ZTS2SA", !13} ; [ DW_TAG_member ] [a] [line 2, size 32, align 32, offset 0] [from int] -!13 = !{!"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] +!12 = !MDDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, file: !1, scope: !"_ZTS2SA", baseType: !13) +!13 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !14 = !{!15, !20} -!15 = !{!"0x2e\00topB\00topB\00_Z4topBP1B2SA\0011\000\001\000\006\00256\000\0011", !1, !16, !17, null, void (%class.B*, i32)* @_Z4topBP1B2SA, null, null, !2} ; [ DW_TAG_subprogram ] [line 11] [def] [topB] -!16 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [b.cpp] -!17 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !18, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!15 = !MDSubprogram(name: "topB", linkageName: "_Z4topBP1B2SA", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 11, file: !1, scope: !16, type: !17, function: void (%class.B*, i32)* @_Z4topBP1B2SA, variables: !2) +!16 = !MDFile(filename: "b.cpp", directory: "/Users/manmanren/test-Nov/type_unique/rdar_di_array") +!17 = !MDSubroutineType(types: !18) !18 = !{null, !19, !"_ZTS2SA"} -!19 = !{!"0xf\00\000\0064\0064\000\000", null, null, !"_ZTS1B"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from _ZTS1B] -!20 = !{!"0x2e\00testB\00testB\00_ZN1B5testBE2SA\007\000\001\000\006\00256\000\007", !1, !"_ZTS1B", !7, null, void (%class.B*, i32)* @_ZN1B5testBE2SA, null, !6, !2} ; [ DW_TAG_subprogram ] [line 7] [def] [testB] +!19 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1B") +!20 = !MDSubprogram(name: "testB", linkageName: "_ZN1B5testBE2SA", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !"_ZTS1B", type: !7, function: void (%class.B*, i32)* @_ZN1B5testBE2SA, declaration: !6, variables: !2) !21 = !{i32 2, !"Dwarf Version", i32 2} -!22 = !{i32 2, !"Debug Info Version", i32 2} +!22 = !{i32 2, !"Debug Info Version", i32 3} !23 = !{!"clang version 3.5.0 (trunk 214102:214113M) (llvm/trunk 214102:214115M)"} -!24 = !{!"0x101\00b\0016777227\000", !15, !16, !19} ; [ DW_TAG_arg_variable ] [b] [line 11] +!24 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 11, arg: 1, scope: !15, file: !16, type: !19) !25 = !MDLocation(line: 11, column: 14, scope: !15) -!26 = !{!"0x101\00sa\0033554443\000", !15, !16, !"_ZTS2SA"} ; [ DW_TAG_arg_variable ] [sa] [line 11] +!26 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "sa", line: 11, arg: 2, scope: !15, file: !16, type: !"_ZTS2SA") !27 = !MDLocation(line: 11, column: 20, scope: !15) !28 = !MDLocation(line: 12, column: 3, scope: !15) !29 = !MDLocation(line: 13, column: 1, scope: !15) -!30 = !{!"0x101\00this\0016777216\001088", !20, null, !19} ; [ DW_TAG_arg_variable ] [this] [line 0] +!30 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !20, type: !19) !31 = !MDLocation(line: 0, scope: !20) -!32 = !{!"0x101\00sa\0033554439\000", !20, !16, !"_ZTS2SA"} ; [ DW_TAG_arg_variable ] [sa] [line 7] +!32 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "sa", line: 7, arg: 2, scope: !20, file: !16, type: !"_ZTS2SA") !33 = !MDLocation(line: 7, column: 17, scope: !20) !34 = !MDLocation(line: 8, column: 3, scope: !20) |