diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 18:44:32 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 18:44:32 +0000 |
commit | 5a5ac124e1efaf208671f01c46edb15f29ed2a0b (patch) | |
tree | a6140557876943cdd800ee997c9317283394b22c /test/Linker | |
parent | f03b5bed27d0d2eafd68562ce14f8b5e3f1f0801 (diff) | |
download | src-5a5ac124e1efaf208671f01c46edb15f29ed2a0b.tar.gz src-5a5ac124e1efaf208671f01c46edb15f29ed2a0b.zip |
Vendor import of llvm trunk r238337:vendor/llvm/llvm-trunk-r238337
Notes
Notes:
svn path=/vendor/llvm/dist/; revision=283625
svn path=/vendor/llvm/llvm-trunk-r238337/; revision=283626; tag=vendor/llvm/llvm-trunk-r238337
Diffstat (limited to 'test/Linker')
83 files changed, 1206 insertions, 853 deletions
diff --git a/test/Linker/2002-08-20-ConstantExpr.ll b/test/Linker/2002-08-20-ConstantExpr.ll index 5672014ff663..f8217930678a 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 4cff9ace430a..b8ce2d9baedb 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 380712717817..2b672761458d 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 8ce1ccb33857..078479424b02 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 1f308e77e9dd..ec444d316b78 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 = !DISubprogram(name: "main", linkageName: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scope: !1) +!1 = !DICompileUnit(language: DW_LANG_C99, producer: "ellcc 0.1.0", isOptimized: true, emissionKind: 0, file: !2) +!2 = !DIFile(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 68e329432a0a..d9d52680b7b0 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 = !DISubprogram(name: "f", linkageName: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scope: !1) +!1 = !DICompileUnit(language: DW_LANG_C99, producer: "ellcc 0.1.0", isOptimized: true, emissionKind: 0, file: !2) +!2 = !DIFile(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 85b9e17c5666..710ddf7774ff 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 = !DICompileUnit(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 = !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !8, scope: !2, type: !3, function: i32 ()* @foo) +!2 = !DIFile(filename: "a.c", directory: "/private/tmp") +!3 = !DISubroutineType(types: !4) !4 = !{!5} -!5 = !{!"0x24\00int\000\0032\0032\000\000\005", null, !0} ; [ DW_TAG_base_type ] -!6 = !MDLocation(line: 2, column: 13, scope: !7) -!7 = !{!"0xb\002\0011\000", !8, !1} ; [ DW_TAG_lexical_block ] -!8 = !{!"a.c", !"/private/tmp"} -!9 = !{i32 0} +!5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!6 = !DILocation(line: 2, column: 13, scope: !7) +!7 = distinct !DILexicalBlock(line: 2, column: 11, file: !8, scope: !1) +!8 = !DIFile(filename: "a.c", directory: "/private/tmp") +!9 = !{} !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 a3cd00100920..bc524dae91de 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 = !DICompileUnit(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 = !DISubprogram(name: "bar", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !8, scope: !2, type: !3, function: i32 ()* @bar) +!2 = !DIFile(filename: "b.c", directory: "/private/tmp") +!3 = !DISubroutineType(types: !4) !4 = !{!5} -!5 = !{!"0x24\00int\000\0032\0032\000\000\005", null, !0} ; [ DW_TAG_base_type ] -!6 = !MDLocation(line: 1, column: 13, scope: !7) -!7 = !{!"0xb\001\0011\000", !8, !1} ; [ DW_TAG_lexical_block ] -!8 = !{!"b.c", !"/private/tmp"} -!9 = !{i32 0} +!5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!6 = !DILocation(line: 1, column: 13, scope: !7) +!7 = distinct !DILexicalBlock(line: 1, column: 11, file: !8, scope: !1) +!8 = !DIFile(filename: "b.c", directory: "/private/tmp") +!9 = !{} !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 da98f20e3f18..fc1af754abd4 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: !DIGlobalVariable(name: "x", +; CHECK-NOT: linkageName: +; CHECK-SAME: variable: i32* @x{{[,)]}} +; CHECK: !DIGlobalVariable(name: "x", +; CHECK-NOT: linkageName: +; CHECK-SAME: variable: i32* @x.1{{[,)]}} 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 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 ()", isOptimized: true, emissionKind: 0, file: !9, enums: !{}, retainedTypes: !{}, subprograms: !10) +!1 = !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !9, scope: !2, type: !3, function: void ()* @foo) +!2 = !DIFile(filename: "/tmp/one.c", directory: "/Volumes/Lalgate/Slate/D") +!3 = !DISubroutineType(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 ] -!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"} +!5 = !DIGlobalVariable(name: "x", line: 2, isLocal: true, isDefinition: true, scope: !0, file: !2, type: !6, variable: i32* @x) +!6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!7 = !DILocation(line: 3, column: 14, scope: !8) +!8 = distinct !DILexicalBlock(line: 3, column: 12, file: !9, scope: !1) +!9 = !DIFile(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 fb196d96df71..5eb231b2e364 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 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 ()", isOptimized: true, emissionKind: 0, file: !9, enums: !{}, retainedTypes: !{}, subprograms: !10) +!1 = !DISubprogram(name: "bar", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !9, scope: !2, type: !3, function: void ()* @bar) +!2 = !DIFile(filename: "/tmp/two.c", directory: "/Volumes/Lalgate/Slate/D") +!3 = !DISubroutineType(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 ] -!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"} +!5 = !DIGlobalVariable(name: "x", line: 1, isLocal: true, isDefinition: true, scope: !0, file: !2, type: !6, variable: i32* @x) +!6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!7 = !DILocation(line: 2, column: 14, scope: !8) +!8 = distinct !DILexicalBlock(line: 2, column: 12, file: !9, scope: !1) +!9 = !DIFile(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 a8f13500a754..1692a90bf7e6 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 !DIExpression()), !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 = !DICompileUnit(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} +!2 = !{} !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 = !DISubprogram(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 = !DIFile(filename: "n1.c", directory: "/private/tmp") +!7 = !DISubroutineType(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 ] -!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} +!9 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "mya", line: 4, arg: 1, scope: !5, file: !6, type: !10) +!10 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 3, size: 8, align: 8, file: !17, scope: !11, elements: !2) +!11 = !DINamespace(name: "N1", line: 2, file: !17, scope: null) +!12 = !DIFile(filename: "./n.h", directory: "/private/tmp") +!13 = !DILocation(line: 4, column: 12, scope: !5) +!14 = !DILocation(line: 4, column: 18, scope: !15) +!15 = distinct !DILexicalBlock(line: 4, column: 17, file: !16, scope: !5) +!16 = !DIFile(filename: "n1.c", directory: "/private/tmp") +!17 = !DIFile(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 dd0df5889ec6..1befb4deacc9 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 !DIExpression()), !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 = !DICompileUnit(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} +!2 = !{} !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 = !DISubprogram(name: "bar", linkageName: "_Z3barN2N11AE", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scope: !6, type: !7, function: void ()* @_Z3barN2N11AE) +!6 = !DIFile(filename: "n2.c", directory: "/private/tmp") +!7 = !DISubroutineType(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 ] -!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} +!9 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "youra", line: 4, arg: 1, scope: !5, file: !6, type: !10) +!10 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 3, size: 8, align: 8, file: !17, scope: !11, elements: !2) +!11 = !DINamespace(name: "N1", line: 2, file: !17, scope: null) +!12 = !DIFile(filename: "./n.h", directory: "/private/tmp") +!13 = !DILocation(line: 4, column: 12, scope: !5) +!14 = !DILocation(line: 4, column: 20, scope: !15) +!15 = distinct !DILexicalBlock(line: 4, column: 19, file: !16, scope: !5) +!16 = !DIFile(filename: "n2.c", directory: "/private/tmp") +!17 = !DIFile(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 c1b3a1d79395..b1da9354f8ce 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: !DIBasicType(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 = !DICompileUnit(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} +!2 = !{} !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 = !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !12, scope: !6, type: !7, function: i32 ()* @foo) +!6 = !DIFile(filename: "one.c", directory: "/private/tmp") +!7 = !DISubroutineType(types: !8) !8 = !{!9} -!9 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] -!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} +!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!10 = !DILocation(line: 1, column: 13, scope: !11) +!11 = distinct !DILexicalBlock(line: 1, column: 11, file: !12, scope: !5) +!12 = !DIFile(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 49c0a5cf6568..40958dabf880 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 = !DICompileUnit(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} +!2 = !{} !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 = !DISubprogram(name: "bar", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !12, scope: !6, type: !7, function: i32 ()* @bar) +!6 = !DIFile(filename: "two.c", directory: "/private/tmp") +!7 = !DISubroutineType(types: !8) !8 = !{!9} -!9 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] -!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} +!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!10 = !DILocation(line: 1, column: 13, scope: !11) +!11 = distinct !DILexicalBlock(line: 1, column: 11, file: !12, scope: !5) +!12 = !DIFile(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 d6df82d45cfc..000000000000 --- 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 c380c23abe41..000000000000 --- 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 5beff5a10777..a3db5d28cd22 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 de5ac9e97b25..a6ffa915c071 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 !DIExpression()), !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 !DIExpression()), !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,23 @@ 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 ] -!1 = !{!2} -!2 = !{i32 0} +!0 = !DICompileUnit(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) +!2 = !{} !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 = !DISubprogram(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: !2) +!6 = !DIFile(filename: "main.cpp", directory: "/private/tmp") +!7 = !DISubroutineType(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 ] -!15 = !MDLocation(line: 3, scope: !5) -!16 = !{!"0x101\00argv\0033554435\000", !5, !6, !10} ; [ DW_TAG_arg_variable ] -!17 = !MDLocation(line: 5, scope: !18) -!18 = !{!"0xb\004\000\000", !20, !5} ; [ DW_TAG_lexical_block ] -!19 = !MDLocation(line: 6, scope: !18) -!20 = !{!"main.cpp", !"/private/tmp"} -!21 = !{i32 1, !"Debug Info Version", i32 2} +!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !11) +!11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !12) +!12 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !13) +!13 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) +!14 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "argc", line: 3, arg: 1, scope: !5, file: !6, type: !9) +!15 = !DILocation(line: 3, scope: !5) +!16 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "argv", line: 3, arg: 2, scope: !5, file: !6, type: !10) +!17 = !DILocation(line: 5, scope: !18) +!18 = distinct !DILexicalBlock(line: 4, column: 0, file: !20, scope: !5) +!19 = !DILocation(line: 6, scope: !18) +!20 = !DIFile(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 2f01b0eaea2e..b716833ecc66 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 !DIExpression()), !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 !DIExpression()), !dbg !15 + call void @llvm.dbg.declare(metadata i32* %i, metadata !17, metadata !DIExpression()), !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,29 @@ 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 ] -!1 = !{!2} -!2 = !{i32 0} +!0 = !DICompileUnit(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) +!2 = !{} !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 = !DISubprogram(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: !2) +!6 = !DIFile(filename: "test.cpp", directory: "/private/tmp") +!7 = !DISubroutineType(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 ] -!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 ] -!20 = !MDLocation(line: 6, scope: !18) -!21 = !MDLocation(line: 8, scope: !22) -!22 = !{!"0xb\007\000\002", !26, !18} ; [ DW_TAG_lexical_block ] -!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} +!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !11) +!11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !12) +!12 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !13) +!13 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) +!14 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "argc", line: 4, arg: 1, scope: !5, file: !6, type: !9) +!15 = !DILocation(line: 4, scope: !5) +!16 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "argv", line: 4, arg: 2, scope: !5, file: !6, type: !10) +!17 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i", line: 6, scope: !18, file: !6, type: !9) +!18 = distinct !DILexicalBlock(line: 6, column: 0, file: !26, scope: !19) +!19 = distinct !DILexicalBlock(line: 5, column: 0, file: !26, scope: !5) +!20 = !DILocation(line: 6, scope: !18) +!21 = !DILocation(line: 8, scope: !22) +!22 = distinct !DILexicalBlock(line: 7, column: 0, file: !26, scope: !18) +!23 = !DILocation(line: 9, scope: !22) +!24 = !DILocation(line: 10, scope: !19) +!25 = !DIFile(filename: "main.cpp", directory: "/private/tmp") +!26 = !DIFile(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 7ef5a361291a..2c74d9c4c3bc 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/apple-version/1.ll b/test/Linker/Inputs/apple-version/1.ll new file mode 100644 index 000000000000..5cafa5ecc1fe --- /dev/null +++ b/test/Linker/Inputs/apple-version/1.ll @@ -0,0 +1 @@ +target triple = "x86_64-apple-macosx10.10.0" diff --git a/test/Linker/Inputs/apple-version/2.ll b/test/Linker/Inputs/apple-version/2.ll new file mode 100644 index 000000000000..b63ea1f8b233 --- /dev/null +++ b/test/Linker/Inputs/apple-version/2.ll @@ -0,0 +1 @@ +target triple = "x86_64-apple-macosx10.8.0" diff --git a/test/Linker/Inputs/apple-version/3.ll b/test/Linker/Inputs/apple-version/3.ll new file mode 100644 index 000000000000..68e58caead9c --- /dev/null +++ b/test/Linker/Inputs/apple-version/3.ll @@ -0,0 +1 @@ +target triple = "i386-apple-macosx10.9.0" diff --git a/test/Linker/Inputs/apple-version/4.ll b/test/Linker/Inputs/apple-version/4.ll new file mode 100644 index 000000000000..467a634a32bd --- /dev/null +++ b/test/Linker/Inputs/apple-version/4.ll @@ -0,0 +1 @@ +target triple = "x86_64h-apple-macosx10.9.0" diff --git a/test/Linker/Inputs/basiclink.b.ll b/test/Linker/Inputs/basiclink.b.ll index 0d2abc771c6d..407aa944837a 100644 --- a/test/Linker/Inputs/basiclink.b.ll +++ b/test/Linker/Inputs/basiclink.b.ll @@ -1,6 +1,6 @@ declare i32* @foo(...) define i32* @bar() { - %ret = call i32* (...)* @foo( i32 123 ) + %ret = call i32* (...) @foo( i32 123 ) ret i32* %ret } @baz = global i32 0 diff --git a/test/Linker/Inputs/comdat5.ll b/test/Linker/Inputs/comdat5.ll index 98c42b7be0c6..19739eb1b5da 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/drop-debug.bc b/test/Linker/Inputs/drop-debug.bc Binary files differnew file mode 100644 index 000000000000..f9c471f8e0d1 --- /dev/null +++ b/test/Linker/Inputs/drop-debug.bc diff --git a/test/Linker/Inputs/linkage.b.ll b/test/Linker/Inputs/linkage.b.ll index 0ada3f4cb428..9c1d06660220 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 f85c1dc7475d..22473db46097 100644 --- a/test/Linker/Inputs/mdlocation.ll +++ b/test/Linker/Inputs/mdlocation.ll @@ -1,13 +1,13 @@ !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9} -!0 = !{} ; 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. -!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) +!0 = !DISubprogram() ; Use this as a scope. +!1 = !DILocation(line: 3, column: 7, scope: !0) +!2 = !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !1) +!3 = !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !2) +!4 = distinct !DISubprogram() ; Test actual remapping. +!5 = !DILocation(line: 3, column: 7, scope: !4) +!6 = !DILocation(line: 3, column: 7, scope: !4, inlinedAt: !5) +!7 = !DILocation(line: 3, column: 7, scope: !4, inlinedAt: !6) ; Test distinct nodes. -!8 = distinct !MDLocation(line: 3, column: 7, scope: !0) -!9 = distinct !MDLocation(line: 3, column: 7, scope: !0, inlinedAt: !8) +!8 = distinct !DILocation(line: 3, column: 7, scope: !0) +!9 = distinct !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !8) diff --git a/test/Linker/Inputs/metadata-function.ll b/test/Linker/Inputs/metadata-function.ll new file mode 100644 index 000000000000..8572ff119837 --- /dev/null +++ b/test/Linker/Inputs/metadata-function.ll @@ -0,0 +1,13 @@ +define weak void @foo() !weak !0 { + unreachable +} + +define void @baz() !baz !0 { + unreachable +} + +define void @b() !b !0 { + unreachable +} + +!0 = !{!"b"} diff --git a/test/Linker/Inputs/opaque.ll b/test/Linker/Inputs/opaque.ll index 2b0d7d3cea8b..f164abd586d1 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/override-different-linkage.ll b/test/Linker/Inputs/override-different-linkage.ll new file mode 100644 index 000000000000..bc1514091801 --- /dev/null +++ b/test/Linker/Inputs/override-different-linkage.ll @@ -0,0 +1,4 @@ +define linkonce i32 @foo(i32 %i) { +entry: + ret i32 4 +} diff --git a/test/Linker/Inputs/override-with-internal-linkage-2.ll b/test/Linker/Inputs/override-with-internal-linkage-2.ll new file mode 100644 index 000000000000..2f54a1511fa1 --- /dev/null +++ b/test/Linker/Inputs/override-with-internal-linkage-2.ll @@ -0,0 +1,4 @@ +define internal i32 @foo(i32 %i) { +entry: + ret i32 4 +} diff --git a/test/Linker/Inputs/override-with-internal-linkage.ll b/test/Linker/Inputs/override-with-internal-linkage.ll new file mode 100644 index 000000000000..6e06fa5c4f75 --- /dev/null +++ b/test/Linker/Inputs/override-with-internal-linkage.ll @@ -0,0 +1,4 @@ +define i32 @foo(i32 %i) { +entry: + ret i32 4 +} diff --git a/test/Linker/Inputs/override.ll b/test/Linker/Inputs/override.ll new file mode 100644 index 000000000000..6e06fa5c4f75 --- /dev/null +++ b/test/Linker/Inputs/override.ll @@ -0,0 +1,4 @@ +define i32 @foo(i32 %i) { +entry: + ret i32 4 +} diff --git a/test/Linker/Inputs/pr22807-1.ll b/test/Linker/Inputs/pr22807-1.ll new file mode 100644 index 000000000000..4081a9b00e43 --- /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 000000000000..7739b77df255 --- /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 a5de89f5a605..efa8ec9c67b0 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 = !DICompileUnit(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 = !DIFile(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 = !DISubprogram(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 = !DIFile(filename: "../t.h", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d2") +!6 = !DIFile(filename: "../t.h", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d2") +!7 = !DISubroutineType(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) +!12 = !DILocation(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 000000000000..71c080173a3d --- /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 !DILocation(line: 2, scope: !3) + ret i32 %sum, !dbg !DILocation(line: 3, scope: !3) +} + +!llvm.module.flags = !{!0} +!0 = !{i32 2, !"Debug Info Version", i32 3} + +!llvm.dbg.cu = !{!1} +!1 = !DICompileUnit(language: DW_LANG_C99, file: !2, subprograms: !{!3}, emissionKind: 1) +!2 = !DIFile(filename: "foo.c", directory: "/path/to/dir") +!3 = !DISubprogram(file: !4, scope: !4, line: 1, name: "foo", function: i32 (i32, i32)* @foo, type: !5) +!4 = !DIFile(filename: "foo.h", directory: "/path/to/dir") +!5 = !DISubroutineType(types: !{}) diff --git a/test/Linker/Inputs/subprogram-linkonce-weak.ll b/test/Linker/Inputs/subprogram-linkonce-weak.ll new file mode 100644 index 000000000000..f5399e244a9c --- /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 !DILocation(line: 52, scope: !3) + ret i32 %sum, !dbg !DILocation(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 = !DICompileUnit(language: DW_LANG_C99, file: !2, subprograms: !{!3}, emissionKind: 1) +!2 = !DIFile(filename: "foo.c", directory: "/path/to/dir") +!3 = !DISubprogram(file: !2, scope: !2, line: 51, name: "foo", function: i32 (i32, i32)* @foo, type: !4) +!4 = !DISubroutineType(types: !{}) diff --git a/test/Linker/Inputs/targettriple-a.ll b/test/Linker/Inputs/targettriple-a.ll index 296d2df3ab6a..b8c7901d3177 100644 --- a/test/Linker/Inputs/targettriple-a.ll +++ b/test/Linker/Inputs/targettriple-a.ll @@ -1 +1 @@ -target triple = "e" +target triple = "x86_64-unknown-linux-gnu" diff --git a/test/Linker/Inputs/targettriple-b.ll b/test/Linker/Inputs/targettriple-b.ll index cca872ec9662..0122b4ac56d9 100644 --- a/test/Linker/Inputs/targettriple-b.ll +++ b/test/Linker/Inputs/targettriple-b.ll @@ -1 +1 @@ -target triple = "E" +target triple = "i386-unknown-linux-gnu" diff --git a/test/Linker/Inputs/targettriple-c.ll b/test/Linker/Inputs/targettriple-c.ll new file mode 100644 index 000000000000..e669a4c40ea0 --- /dev/null +++ b/test/Linker/Inputs/targettriple-c.ll @@ -0,0 +1 @@ +target triple = "x86_64h-unknown-linux-gnu" diff --git a/test/Linker/Inputs/testlink.ll b/test/Linker/Inputs/testlink.ll index 89f02ba95904..263d9e77d1ab 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 c503919349ff..75cc7e1c838a 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: !DICompositeType(tag: DW_TAG_class_type, name: "A" +; CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "Base" +; CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "B" +; CHECK-NOT: !DICompositeType(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 !DIExpression()), !dbg !21 + call void @llvm.dbg.declare(metadata %class.A* %t, metadata !22, metadata !DIExpression()), !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"} -!2 = !{i32 0} +!0 = !DICompileUnit(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 = !DIFile(filename: "foo.cpp", directory: "/Users/mren/c_testing/type_unique_air/inher") +!2 = !{} !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 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 3, size: 64, align: 32, file: !5, elements: !6, identifier: "_ZTS1A") +!5 = !DIFile(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 = !DIDerivedType(tag: DW_TAG_inheritance, flags: DIFlagPrivate, scope: !"_ZTS1A", baseType: !8) +!8 = !DICompositeType(tag: DW_TAG_class_type, name: "Base", line: 3, size: 32, align: 32, file: !9, elements: !10, identifier: "_ZTS4Base") +!9 = !DIFile(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 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 4, size: 32, align: 32, flags: DIFlagPrivate, file: !9, scope: !"_ZTS4Base", baseType: !12) +!12 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!13 = !DIDerivedType(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 = !DISubprogram(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 = !DIFile(filename: "foo.cpp", directory: "/Users/mren/c_testing/type_unique_air/inher") +!17 = !DISubroutineType(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] -!21 = !MDLocation(line: 5, scope: !15) -!22 = !{!"0x100\00t\006\000", !15, !16, !4} ; [ DW_TAG_auto_variable ] [t] [line 6] -!23 = !MDLocation(line: 6, scope: !15) -!24 = !MDLocation(line: 7, scope: !15) -!25 = !{i32 1, !"Debug Info Version", i32 2} +!20 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 5, arg: 1, scope: !15, file: !16, type: !12) +!21 = !DILocation(line: 5, scope: !15) +!22 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "t", line: 6, scope: !15, file: !16, type: !4) +!23 = !DILocation(line: 6, scope: !15) +!24 = !DILocation(line: 7, scope: !15) +!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 d3b9dead03cd..dd89b8dd42df 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 !DIExpression()), !dbg !29 + call void @llvm.dbg.declare(metadata %class.B* %t, metadata !30, metadata !DIExpression()), !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 !DIExpression()), !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"} -!2 = !{i32 0} +!0 = !DICompileUnit(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 = !DIFile(filename: "bar.cpp", directory: "/Users/mren/c_testing/type_unique_air/inher") +!2 = !{} !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 = !DICompositeType(tag: DW_TAG_class_type, name: "B", line: 7, size: 128, align: 64, file: !5, elements: !6, identifier: "_ZTS1B") +!5 = !DIFile(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 = !DIDerivedType(tag: DW_TAG_member, name: "bb", line: 8, size: 32, align: 32, flags: DIFlagPrivate, file: !5, scope: !"_ZTS1B", baseType: !8) +!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 9, size: 64, align: 64, offset: 64, flags: DIFlagPrivate, file: !5, scope: !"_ZTS1B", baseType: !10) +!10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !11) +!11 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 3, size: 64, align: 32, file: !12, elements: !13, identifier: "_ZTS1A") +!12 = !DIFile(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 = !DIDerivedType(tag: DW_TAG_inheritance, flags: DIFlagPrivate, scope: !"_ZTS1A", baseType: !15) +!15 = !DICompositeType(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 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 4, size: 32, align: 32, flags: DIFlagPrivate, file: !5, scope: !"_ZTS4Base", baseType: !8) +!18 = !DIDerivedType(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 = !DISubprogram(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 = !DIFile(filename: "bar.cpp", directory: "/Users/mren/c_testing/type_unique_air/inher") +!22 = !DISubroutineType(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 = !DISubprogram(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 = !DISubroutineType(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] -!29 = !MDLocation(line: 4, scope: !20) -!30 = !{!"0x100\00t\005\000", !20, !21, !4} ; [ DW_TAG_auto_variable ] [t] [line 5] -!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] -!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} +!28 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 4, arg: 1, scope: !20, file: !21, type: !8) +!29 = !DILocation(line: 4, scope: !20) +!30 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "t", line: 5, scope: !20, file: !21, type: !4) +!31 = !DILocation(line: 5, scope: !20) +!32 = !DILocation(line: 6, scope: !20) +!33 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 10, scope: !24, file: !21, type: !11) +!34 = !DILocation(line: 10, scope: !24) +!35 = !DILocation(line: 11, scope: !24) +!36 = !DILocation(line: 12, scope: !24) +!37 = !DILocation(line: 13, scope: !24) +!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 6d6e93c68f00..c07157bf87b6 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 !DIExpression()), !dbg !18 + call void @llvm.dbg.declare(metadata %struct.Base* %t, metadata !19, metadata !DIExpression()), !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 = !DICompileUnit(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 = !DIFile(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 = !DICompositeType(tag: DW_TAG_structure_type, name: "Base", line: 1, size: 128, align: 64, file: !5, elements: !6, identifier: "_ZTS4Base") +!5 = !DIFile(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 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, file: !5, scope: !"_ZTS4Base", baseType: !8) +!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 3, size: 64, align: 64, offset: 64, file: !5, scope: !"_ZTS4Base", baseType: !10) +!10 = !DIDerivedType(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 = !DISubprogram(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 = !DIFile(filename: "foo.cpp", directory: ".") +!14 = !DISubroutineType(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] -!18 = !MDLocation(line: 3, scope: !12) -!19 = !{!"0x100\00t\004\000", !12, !13, !4} ; [ DW_TAG_auto_variable ] [t] [line 4] -!20 = !MDLocation(line: 4, scope: !12) -!21 = !MDLocation(line: 5, scope: !12) -!22 = !{i32 1, !"Debug Info Version", i32 2} +!17 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 3, arg: 1, scope: !12, file: !13, type: !8) +!18 = !DILocation(line: 3, scope: !12) +!19 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "t", line: 4, scope: !12, file: !13, type: !4) +!20 = !DILocation(line: 4, scope: !12) +!21 = !DILocation(line: 5, scope: !12) +!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 d3b2f7e514c6..817f88704de5 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 !DIExpression()), !dbg !21 + call void @llvm.dbg.declare(metadata %struct.Base* %t, metadata !22, metadata !DIExpression()), !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 = !DICompileUnit(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 = !DIFile(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 = !DICompositeType(tag: DW_TAG_structure_type, name: "Base", line: 1, size: 128, align: 64, file: !5, elements: !6, identifier: "_ZTS4Base") +!5 = !DIFile(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 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, file: !5, scope: !"_ZTS4Base", baseType: !8) +!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 3, size: 64, align: 64, offset: 64, file: !5, scope: !"_ZTS4Base", baseType: !10) +!10 = !DIDerivedType(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 = !DISubprogram(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 = !DIFile(filename: "bar.cpp", directory: ".") +!14 = !DISubroutineType(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 = !DISubprogram(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 = !DISubroutineType(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] -!21 = !MDLocation(line: 4, scope: !12) -!22 = !{!"0x100\00t\005\000", !12, !13, !4} ; [ DW_TAG_auto_variable ] [t] [line 5] -!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} +!20 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 4, arg: 1, scope: !12, file: !13, type: !8) +!21 = !DILocation(line: 4, scope: !12) +!22 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "t", line: 5, scope: !12, file: !13, type: !4) +!23 = !DILocation(line: 5, scope: !12) +!24 = !DILocation(line: 6, scope: !12) +!25 = !DILocation(line: 8, scope: !16) +!26 = !DILocation(line: 9, scope: !16) +!27 = !DILocation(line: 10, scope: !16) +!28 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Linker/apple-version.ll b/test/Linker/apple-version.ll new file mode 100644 index 000000000000..4dbc866ac3d7 --- /dev/null +++ b/test/Linker/apple-version.ll @@ -0,0 +1,24 @@ +; RUN: llvm-link %s %S/Inputs/apple-version/1.ll -S -o - 2>%t.err | FileCheck %s -check-prefix=CHECK1 +; RUN: cat %t.err | FileCheck --check-prefix=WARN1 --allow-empty %s +; RUN: llvm-link %s %S/Inputs/apple-version/2.ll -S -o - 2>%t.err | FileCheck %s -check-prefix=CHECK2 +; RUN: cat %t.err | FileCheck --check-prefix=WARN2 --allow-empty %s +; RUN: llvm-link %s %S/Inputs/apple-version/3.ll -S -o /dev/null 2>%t.err +; RUN: cat %t.err | FileCheck --check-prefix=WARN3 %s +; RUN: llvm-link %s %S/Inputs/apple-version/4.ll -S -o /dev/null 2>%t.err +; RUN: cat %t.err | FileCheck --check-prefix=WARN4 --allow-empty %s + +; Check that the triple that has the larger version number is chosen and no +; warnings are issued when the Triples differ only in version numbers. + +; CHECK1: target triple = "x86_64-apple-macosx10.10.0" +; WARN1-NOT: WARNING +; CHECK2: target triple = "x86_64-apple-macosx10.9.0" +; WARN2-NOT: WARNING + +; i386 and x86_64 map to different ArchType enums. +; WARN3: WARNING: Linking two modules of different target triples + +; x86_64h and x86_64 map to the same ArchType enum. +; WARN4-NOT: WARNING + +target triple = "x86_64-apple-macosx10.9.0" diff --git a/test/Linker/broken.ll b/test/Linker/broken.ll new file mode 100644 index 000000000000..8aefe4e6a37d --- /dev/null +++ b/test/Linker/broken.ll @@ -0,0 +1,8 @@ +; RUN: not llvm-link -o /dev/null %s 2>&1 | FileCheck %s + +; CHECK: broken.ll: error: input module 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 3b5db0a39a0b..000000000000 --- 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 b5360a7c7da3..15be2fe58036 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 8cbfc198a684..cba28776eb57 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 352fcdcb77ca..8cc85b167f71 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: !DIFile(filename: "b.c", directory: "") +; CHECK: !DIFile(filename: "a.c", directory: "") +; CHECK-NOT: !DIFile(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 = !DICompileUnit(language: DW_LANG_C99, producer: "clang", isOptimized: true, emissionKind: 0, file: !2, enums: !3, retainedTypes: !3, subprograms: !3) +!2 = !DIFile(filename: "a.c", directory: "") !3 = !{} diff --git a/test/Linker/debug-info-version-b.ll b/test/Linker/debug-info-version-b.ll index e4944202f421..b2452f437023 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 = !DICompileUnit(language: DW_LANG_C99, producer: "clang", isOptimized: false, file: !"I AM UNEXPECTED!") !2 = !{!"b.c", !""} !3 = !{} diff --git a/test/Linker/drop-debug.ll b/test/Linker/drop-debug.ll new file mode 100644 index 000000000000..9c1072a75de2 --- /dev/null +++ b/test/Linker/drop-debug.ll @@ -0,0 +1,6 @@ +; RUN: llvm-link %p/Inputs/drop-debug.bc -o %t 2>&1 | FileCheck %s + +;; drop-debug.bc was created from "void f(void) {}" with clang 3.5 and +; -gline-tables-only, so it contains old debug info. + +; CHECK: warning: ignoring debug info with an invalid version (1) in {{.*}}/Inputs/drop-debug.bc diff --git a/test/Linker/link-global-to-func.ll b/test/Linker/link-global-to-func.ll index 4d83fe59e894..f7adde94c139 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 5ee366cbb433..9acc6701599b 100644 --- a/test/Linker/mdlocation.ll +++ b/test/Linker/mdlocation.ll @@ -1,34 +1,34 @@ ; RUN: llvm-link %s %S/Inputs/mdlocation.ll -o - -S | FileCheck %s -; Test that MDLocations are remapped properly. +; Test that DILocations are remapped properly. ; 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-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: !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: !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. -!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. -!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) +; CHECK: !0 = !DISubprogram( +; CHECK-NEXT: !1 = !DILocation(line: 3, column: 7, scope: !0) +; CHECK-NEXT: !2 = !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !1) +; CHECK-NEXT: !3 = !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !2) +; CHECK-NEXT: !4 = distinct !DISubprogram( +; CHECK-NEXT: !5 = !DILocation(line: 3, column: 7, scope: !4) +; CHECK-NEXT: !6 = !DILocation(line: 3, column: 7, scope: !4, inlinedAt: !5) +; CHECK-NEXT: !7 = !DILocation(line: 3, column: 7, scope: !4, inlinedAt: !6) +; CHECK-NEXT: !8 = distinct !DILocation(line: 3, column: 7, scope: !0) +; CHECK-NEXT: !9 = distinct !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !8) +; CHECK-NEXT: !10 = distinct !DISubprogram( +; CHECK-NEXT: !11 = !DILocation(line: 3, column: 7, scope: !10) +; CHECK-NEXT: !12 = !DILocation(line: 3, column: 7, scope: !10, inlinedAt: !11) +; CHECK-NEXT: !13 = !DILocation(line: 3, column: 7, scope: !10, inlinedAt: !12) +; CHECK-NEXT: !14 = distinct !DILocation(line: 3, column: 7, scope: !0) +; CHECK-NEXT: !15 = distinct !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !14) +!0 = !DISubprogram() ; Use this as a scope. +!1 = !DILocation(line: 3, column: 7, scope: !0) +!2 = !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !1) +!3 = !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !2) +!4 = distinct !DISubprogram() ; Test actual remapping. +!5 = !DILocation(line: 3, column: 7, scope: !4) +!6 = !DILocation(line: 3, column: 7, scope: !4, inlinedAt: !5) +!7 = !DILocation(line: 3, column: 7, scope: !4, inlinedAt: !6) ; Test distinct nodes. -!8 = distinct !MDLocation(line: 3, column: 7, scope: !0) -!9 = distinct !MDLocation(line: 3, column: 7, scope: !0, inlinedAt: !8) +!8 = distinct !DILocation(line: 3, column: 7, scope: !0) +!9 = distinct !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !8) diff --git a/test/Linker/metadata-function.ll b/test/Linker/metadata-function.ll new file mode 100644 index 000000000000..0b17e0c58588 --- /dev/null +++ b/test/Linker/metadata-function.ll @@ -0,0 +1,26 @@ +; RUN: llvm-link %s %S/Inputs/metadata-function.ll -S | FileCheck %s +; RUN: llvm-link %S/Inputs/metadata-function.ll %s -S | FileCheck %s + +; CHECK-DAG: define weak void @foo() !weak ![[B:[0-9]+]] { +define linkonce void @foo() !linkonce !0 { + unreachable +} + +; CHECK-DAG: define void @bar() !bar ![[A:[0-9]+]] { +define void @bar() !bar !0 { + call void @baz() + unreachable +} + +; CHECK-DAG: define void @baz() !baz ![[B]] { +declare void @baz() + +; CHECK-DAG: define void @a() !a ![[A]] { +; CHECK-DAG: define void @b() !b ![[B]] { +define void @a() !a !0 { + unreachable +} + +; CHECK-DAG: ![[A]] = !{!"a"} +; CHECK-DAG: ![[B]] = !{!"b"} +!0 = !{!"a"} diff --git a/test/Linker/module-flags-3-b.ll b/test/Linker/module-flags-3-b.ll index 2e6e5297eada..a983db20e5af 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 25aaf190dc81..02d26033b51a 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 1ba878c6a36f..4f3f398f8f1b 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/override-different-linkage.ll b/test/Linker/override-different-linkage.ll new file mode 100644 index 000000000000..19961f2486a0 --- /dev/null +++ b/test/Linker/override-different-linkage.ll @@ -0,0 +1,19 @@ +; RUN: llvm-link %s -override %S/Inputs/override-different-linkage.ll -S | FileCheck %s +; RUN: llvm-link -override %S/Inputs/override-different-linkage.ll %s -S | FileCheck %s + + +; CHECK-LABEL: define linkonce i32 @foo +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32 4 +define weak i32 @foo(i32 %i) { +entry: + %add = add nsw i32 %i, %i + ret i32 %add +} + +; Function Attrs: nounwind ssp uwtable +define i32 @main(i32 %argc, i8** %argv) { +entry: + %a = call i32 @foo(i32 2) + ret i32 %a +} diff --git a/test/Linker/override-with-internal-linkage-2.ll b/test/Linker/override-with-internal-linkage-2.ll new file mode 100644 index 000000000000..45b131fe5797 --- /dev/null +++ b/test/Linker/override-with-internal-linkage-2.ll @@ -0,0 +1,23 @@ +; RUN: llvm-link %s -override %S/Inputs/override-with-internal-linkage-2.ll -S | FileCheck %s +; RUN: llvm-link -override %S/Inputs/override-with-internal-linkage-2.ll %s -S | FileCheck %s + +; CHECK-LABEL: define i32 @foo +; CHECK-NEXT: entry: +; CHECK-NEXT: %add = add nsw i32 %i, %i +; CHECK-NEXT: ret i32 %add +define i32 @foo(i32 %i) { +entry: + %add = add nsw i32 %i, %i + ret i32 %add +} + +; CHECK-LABEL: define internal i32 @foo.1 +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32 4 + +; Function Attrs: nounwind ssp uwtable +define i32 @main(i32 %argc, i8** %argv) { +entry: + %a = call i32 @foo(i32 2) + ret i32 %a +} diff --git a/test/Linker/override-with-internal-linkage.ll b/test/Linker/override-with-internal-linkage.ll new file mode 100644 index 000000000000..d3a794799322 --- /dev/null +++ b/test/Linker/override-with-internal-linkage.ll @@ -0,0 +1,25 @@ +; RUN: llvm-link %s -override %S/Inputs/override-with-internal-linkage.ll -S | FileCheck %s +; RUN: llvm-link -override %S/Inputs/override-with-internal-linkage.ll %s -S | FileCheck %s + +; CHECK-LABEL: define i32 @main( +; CHECK-NEXT: entry: +; CHECK-NEXT: call i32 @foo2( +define i32 @main(i32 %argc, i8** %argv) { +entry: + %a = call i32 @foo(i32 2) + ret i32 %a +} + +; CHECK-LABEL: define internal i32 @foo2( +; CHECK-NEXT: entry: +; CHECK-NEXT: %add = add nsw i32 %i, %i +; CHECK-NEXT: ret i32 %add +define internal i32 @foo(i32 %i) { +entry: + %add = add nsw i32 %i, %i + ret i32 %add +} + +; CHECK-LABEL: define i32 @foo( +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32 4 diff --git a/test/Linker/override.ll b/test/Linker/override.ll new file mode 100644 index 000000000000..015cb4c382a9 --- /dev/null +++ b/test/Linker/override.ll @@ -0,0 +1,19 @@ +; RUN: llvm-link %s -override %S/Inputs/override.ll -S | FileCheck %s +; RUN: llvm-link -override %S/Inputs/override.ll %s -S | FileCheck %s + + +; CHECK-LABEL: define i32 @foo +; CHECK-NEXT: entry: +; CHECK-NEXT: ret i32 4 +define i32 @foo(i32 %i) { +entry: + %add = add nsw i32 %i, %i + ret i32 %add +} + +; Function Attrs: nounwind ssp uwtable +define i32 @main(i32 %argc, i8** %argv) { +entry: + %a = call i32 @foo(i32 2) + ret i32 %a +} diff --git a/test/Linker/partial-type-refinement-link.ll b/test/Linker/partial-type-refinement-link.ll index 320ef969f83a..0c921110f9e3 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 b995f11533fe..e9a645b077ea 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 000000000000..bb4ca2b4ccfb --- /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 c0ec5f3cd228..fc7e653786e6 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,37 +39,41 @@ 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]] = !DICompileUnit({{.*}} subprograms: ![[SPs1:[0-9]+]] +; CHECK-DAG: ![[CU2]] = !DICompileUnit({{.*}} subprograms: ![[SPs2:[0-9]+]] +!0 = !DICompileUnit(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 = !DIFile(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 = !DISubprogram(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 = !DIFile(filename: "t1.cpp", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1") +!6 = !DISubroutineType(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]] = !DISubprogram({{.*}} function: i32 ()* @_Z3foov +; CHECK-DAG: ![[SP2]] = !DISubprogram({{.*}} 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]] = {{.*}}!DISubprogram({{.*}} isOptimized: false, variables: +!7 = !DISubprogram(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]] = !DIFile(filename: "../t.h", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d2") +!8 = !DIFile(filename: "../t.h", directory: "/Users/dexonsmith/data/llvm/staging/test/Linker/repro/d1") +!9 = !DIFile(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) +!14 = !DILocation(line: 2, column: 20, scope: !4) ; The same subprogram should be pointed to by inside the !dbg reference. -; CHECK: ![[LOC]] = !MDLocation(line: 2, column: 15, scope: ![[SP2]]) -!15 = !MDLocation(line: 2, column: 15, scope: !7) +; CHECK: ![[LOC]] = !DILocation(line: 2, column: 15, scope: ![[SP2]]) +!15 = !DILocation(line: 2, column: 15, scope: !7) diff --git a/test/Linker/subprogram-linkonce-weak-odr.ll b/test/Linker/subprogram-linkonce-weak-odr.ll new file mode 100644 index 000000000000..c1fa0a5adeb5 --- /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 !DILocation(line: 2, scope: !4, + inlinedAt: !DILocation(line: 12, scope: !3)) + ret i32 %sum, !dbg !DILocation(line: 13, scope: !3) +} + +define linkonce_odr i32 @foo(i32 %a, i32 %b) { +entry: + %sum = add i32 %a, %b, !dbg !DILocation(line: 2, scope: !4) + ret i32 %sum, !dbg !DILocation(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]] = !DICompileUnit({{.*}} subprograms: ![[LSPs:[0-9]+]] +; LW: ![[LSPs]] = !{![[BARSP:[0-9]+]], ![[FOOSP:[0-9]+]]} +; LW: ![[BARSP]] = !DISubprogram(name: "bar", +; LW-SAME: function: i32 (i32, i32)* @bar +; LW: ![[FOOSP]] = {{.*}}!DISubprogram(name: "foo", +; LW-NOT: function: +; LW-SAME: ){{$}} +; LW: ![[WCU]] = !DICompileUnit({{.*}} subprograms: ![[WSPs:[0-9]+]] +; LW: ![[WSPs]] = !{![[WEAKFOOSP:[0-9]+]]} +; LW: ![[WEAKFOOSP]] = !DISubprogram(name: "foo", +; LW-SAME: function: i32 (i32, i32)* @foo +; LW: ![[FOOINBAR]] = !DILocation(line: 2, scope: ![[FOOSP]], inlinedAt: ![[BARIA:[0-9]+]]) +; LW: ![[BARIA]] = !DILocation(line: 12, scope: ![[BARSP]]) +; LW: ![[BARRET]] = !DILocation(line: 13, scope: ![[BARSP]]) +; LW: ![[FOOADD]] = !DILocation(line: 2, scope: ![[WEAKFOOSP]]) +; LW: ![[FOORET]] = !DILocation(line: 3, scope: ![[WEAKFOOSP]]) + +; Same as above, but reordered. +; WL: ![[WCU]] = !DICompileUnit({{.*}} subprograms: ![[WSPs:[0-9]+]] +; WL: ![[WSPs]] = !{![[WEAKFOOSP:[0-9]+]]} +; WL: ![[WEAKFOOSP]] = !DISubprogram(name: "foo", +; WL-SAME: function: i32 (i32, i32)* @foo +; WL: ![[LCU]] = !DICompileUnit({{.*}} 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]] = !DISubprogram(name: "bar", +; WL-SAME: function: i32 (i32, i32)* @bar +; WL: ![[FOOADD]] = !DILocation(line: 2, scope: ![[WEAKFOOSP]]) +; WL: ![[FOORET]] = !DILocation(line: 3, scope: ![[WEAKFOOSP]]) +; WL: ![[FOOINBAR]] = !DILocation(line: 2, scope: ![[WEAKFOOSP]], inlinedAt: ![[BARIA:[0-9]+]]) +; WL: ![[BARIA]] = !DILocation(line: 12, scope: ![[BARSP]]) +; WL: ![[BARRET]] = !DILocation(line: 13, scope: ![[BARSP]]) + +!1 = !DICompileUnit(language: DW_LANG_C99, file: !2, subprograms: !{!3, !4}, emissionKind: 1) +!2 = !DIFile(filename: "bar.c", directory: "/path/to/dir") +!3 = !DISubprogram(file: !2, scope: !2, line: 11, name: "bar", function: i32 (i32, i32)* @bar, type: !6) +!4 = !DISubprogram(file: !5, scope: !5, line: 1, name: "foo", function: i32 (i32, i32)* @foo, type: !6) +!5 = !DIFile(filename: "foo.h", directory: "/path/to/dir") +!6 = !DISubroutineType(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 000000000000..598cea7afeb0 --- /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 !DILocation(line: 2, scope: !4, + inlinedAt: !DILocation(line: 12, scope: !3)) + ret i32 %sum, !dbg !DILocation(line: 13, scope: !3) +} + +define linkonce i32 @foo(i32 %a, i32 %b) { +entry: + %sum = add i32 %a, %b, !dbg !DILocation(line: 2, scope: !4) + ret i32 %sum, !dbg !DILocation(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]] = !DICompileUnit({{.*}} subprograms: ![[LSPs:[0-9]+]] +; LW: ![[LSPs]] = !{![[BARSP:[0-9]+]], ![[FOOSP:[0-9]+]]} +; LW: ![[BARSP]] = !DISubprogram(name: "bar", +; LW-SAME: function: i32 (i32, i32)* @bar +; LW: ![[FOOSP]] = {{.*}}!DISubprogram(name: "foo", +; LW-NOT: function: +; LW-SAME: ){{$}} +; LW: ![[WCU]] = !DICompileUnit({{.*}} subprograms: ![[WSPs:[0-9]+]] +; LW: ![[WSPs]] = !{![[WEAKFOOSP:[0-9]+]]} +; LW: ![[WEAKFOOSP]] = !DISubprogram(name: "foo", +; LW-SAME: function: i32 (i32, i32)* @foo +; LW: ![[FOOINBAR]] = !DILocation(line: 2, scope: ![[FOOSP]], inlinedAt: ![[BARIA:[0-9]+]]) +; LW: ![[BARIA]] = !DILocation(line: 12, scope: ![[BARSP]]) +; LW: ![[BARRET]] = !DILocation(line: 13, scope: ![[BARSP]]) +; LW: ![[FOOCALL]] = !DILocation(line: 52, scope: ![[WEAKFOOSP]]) +; LW: ![[FOORET]] = !DILocation(line: 53, scope: ![[WEAKFOOSP]]) + +; Same as above, but reordered. +; WL: ![[WCU]] = !DICompileUnit({{.*}} subprograms: ![[WSPs:[0-9]+]] +; WL: ![[WSPs]] = !{![[WEAKFOOSP:[0-9]+]]} +; WL: ![[WEAKFOOSP]] = !DISubprogram(name: "foo", +; WL-SAME: function: i32 (i32, i32)* @foo +; WL: ![[LCU]] = !DICompileUnit({{.*}} subprograms: ![[LSPs:[0-9]+]] +; WL: ![[LSPs]] = !{![[BARSP:[0-9]+]], ![[FOOSP:[0-9]+]]} +; WL: ![[BARSP]] = !DISubprogram(name: "bar", +; WL-SAME: function: i32 (i32, i32)* @bar +; WL: ![[FOOSP]] = {{.*}}!DISubprogram(name: "foo", +; Note, for symmetry, this should be "NOT: function:" and "SAME: ){{$}}". +; WL-SAME: function: i32 (i32, i32)* @foo +; WL: ![[FOOCALL]] = !DILocation(line: 52, scope: ![[WEAKFOOSP]]) +; WL: ![[FOORET]] = !DILocation(line: 53, scope: ![[WEAKFOOSP]]) +; WL: ![[FOOINBAR]] = !DILocation(line: 2, scope: ![[FOOSP]], inlinedAt: ![[BARIA:[0-9]+]]) +; WL: ![[BARIA]] = !DILocation(line: 12, scope: ![[BARSP]]) +; WL: ![[BARRET]] = !DILocation(line: 13, scope: ![[BARSP]]) + +!1 = !DICompileUnit(language: DW_LANG_C99, file: !2, subprograms: !{!3, !4}, emissionKind: 1) +!2 = !DIFile(filename: "bar.c", directory: "/path/to/dir") +!3 = !DISubprogram(file: !2, scope: !2, line: 11, name: "bar", function: i32 (i32, i32)* @bar, type: !5) +!4 = !DISubprogram(file: !2, scope: !2, line: 1, name: "foo", function: i32 (i32, i32)* @foo, type: !5) +!5 = !DISubroutineType(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 c544a14a19d3..a159797856c8 100644 --- a/test/Linker/targettriple.ll +++ b/test/Linker/targettriple.ll @@ -1,17 +1,22 @@ -; REQUIRES: shell ; RUN: llvm-link %s %S/Inputs/targettriple-a.ll -S -o - 2>%t.a.err | FileCheck %s -; RUN: (echo foo ;cat %t.a.err) | FileCheck --check-prefix=WARN-A %s +; RUN: cat %t.a.err | FileCheck --check-prefix=WARN-A %s --allow-empty ; RUN: llvm-link %s %S/Inputs/targettriple-b.ll -S -o - 2>%t.b.err | FileCheck %s ; RUN: cat %t.b.err | FileCheck --check-prefix=WARN-B %s +; RUN: llvm-link %s %S/Inputs/targettriple-c.ll -S -o - 2>%t.c.err | FileCheck %s +; RUN: cat %t.c.err | FileCheck --check-prefix=WARN-C %s --allow-empty ; RUN: llvm-link -suppress-warnings %s %S/Inputs/targettriple-b.ll -S -o - 2>%t.no-warn.err | FileCheck %s -; RUN: (echo foo ;cat %t.no-warn.err) | FileCheck --check-prefix=WARN-A %s +; RUN: cat %t.no-warn.err | FileCheck --check-prefix=WARN-A %s --allow-empty -target triple = "e" +target triple = "x86_64-unknown-linux-gnu" -; CHECK: target triple = "e" +; CHECK: target triple = "x86_64-unknown-linux-gnu" ; WARN-A-NOT: WARNING +; i386 and x86_64 map to different ArchType enums. ; WARN-B: WARNING: Linking two modules of different target triples: + +; x86_64h and x86_64 map to the same ArchType enum. +; WARN-C-NOT: WARNING diff --git a/test/Linker/testlink.ll b/test/Linker/testlink.ll index aad4b9bfb07a..2e9447ddfd37 100644 --- a/test/Linker/testlink.ll +++ b/test/Linker/testlink.ll @@ -61,7 +61,7 @@ @AConst = linkonce constant i32 123 ; Renamed version of Intern1. -; CHECK-DAG: @Intern1{{[0-9]+}} = internal constant i32 52 +; CHECK-DAG: @Intern1.{{[0-9]+}} = internal constant i32 52 ; Globals linked from testlink2. @@ -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 900b03592647..fa6b6bb4f221 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 !DIExpression()), !dbg !25 ret void, !dbg !26 } @@ -73,30 +73,29 @@ 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 = !DICompileUnit(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 = !DIFile(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 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 1, size: 32, align: 32, file: !5, elements: !6, identifier: "_ZTS1A") +!5 = !DIFile(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 = !DIDerivedType(tag: DW_TAG_member, name: "data", line: 2, size: 32, align: 32, flags: DIFlagPrivate, file: !5, scope: !"_ZTS1A", baseType: !8) +!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !DISubprogram(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) +!10 = !DISubroutineType(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] -!13 = !{i32 786468} +!12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") !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 = !DISubprogram(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 = !DIFile(filename: "type-unique-odr-a.cpp", directory: "") +!17 = !DISubroutineType(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 = !DISubprogram(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] -!25 = !MDLocation(line: 8, scope: !19) -!26 = !MDLocation(line: 9, scope: !19) +!23 = !DILocation(line: 11, scope: !15) +!24 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 8, scope: !19, file: !16, type: !"_ZTS1A") +!25 = !DILocation(line: 8, scope: !19) +!26 = !DILocation(line: 9, scope: !19) diff --git a/test/Linker/type-unique-odr-b.ll b/test/Linker/type-unique-odr-b.ll index b262191b91fc..f57c21da824b 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 !DIExpression()), !dbg !26 + %this1 = load %class.A*, %class.A** %this.addr ret void, !dbg !27 } @@ -54,33 +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 = !DICompileUnit(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 = !DIFile(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 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 2, size: 32, align: 32, file: !5, elements: !6, identifier: "_ZTS1A") +!5 = !DIFile(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 = !DIDerivedType(tag: DW_TAG_member, name: "data", line: 3, size: 32, align: 32, flags: DIFlagPrivate, file: !5, scope: !"_ZTS1A", baseType: !8) +!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !DISubprogram(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) +!10 = !DISubroutineType(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] -!13 = !{i32 786468} +!12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") !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 = !DISubprogram(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 = !DISubprogram(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 = !DIFile(filename: "type-unique-odr-b.cpp", directory: "") +!18 = !DISubroutineType(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 = !DISubprogram(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] -!26 = !MDLocation(line: 0, scope: !15) -!27 = !MDLocation(line: 8, scope: !15) -!28 = !MDLocation(line: 11, scope: !16) -!29 = !MDLocation(line: 10, scope: !20) +!24 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !15, type: !25) +!25 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1A") +!26 = !DILocation(line: 0, scope: !15) +!27 = !DILocation(line: 8, scope: !15) +!28 = !DILocation(line: 11, scope: !16) +!29 = !DILocation(line: 10, scope: !20) diff --git a/test/Linker/type-unique-simple-a.ll b/test/Linker/type-unique-simple-a.ll index ef29cd9781d7..1ab43d657e15 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 !DIExpression()), !dbg !16 + call void @llvm.dbg.declare(metadata %struct.Base* %t, metadata !17, metadata !DIExpression()), !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 = !DICompileUnit(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 = !DIFile(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 = !DICompositeType(tag: DW_TAG_structure_type, name: "Base", line: 1, size: 32, align: 32, file: !5, elements: !6, identifier: "_ZTS4Base") +!5 = !DIFile(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 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, file: !5, scope: !"_ZTS4Base", baseType: !8) +!8 = !DIBasicType(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 = !DISubprogram(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 = !DIFile(filename: "foo.cpp", directory: "/Users/mren/c_testing/type_unique_air/simple") +!12 = !DISubroutineType(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] -!16 = !MDLocation(line: 3, scope: !10) -!17 = !{!"0x100\00t\004\000", !10, !11, !4} ; [ DW_TAG_auto_variable ] [t] [line 4] -!18 = !MDLocation(line: 4, scope: !10) -!19 = !MDLocation(line: 5, scope: !10) -!20 = !{i32 1, !"Debug Info Version", i32 2} +!15 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 3, arg: 1, scope: !10, file: !11, type: !8) +!16 = !DILocation(line: 3, scope: !10) +!17 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "t", line: 4, scope: !10, file: !11, type: !4) +!18 = !DILocation(line: 4, scope: !10) +!19 = !DILocation(line: 5, scope: !10) +!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 fb1a5292975f..c12b91845299 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 !DIExpression()), !dbg !19 + call void @llvm.dbg.declare(metadata %struct.Base* %t, metadata !20, metadata !DIExpression()), !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 = !DICompileUnit(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 = !DIFile(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 = !DICompositeType(tag: DW_TAG_structure_type, name: "Base", line: 1, size: 32, align: 32, file: !5, elements: !6, identifier: "_ZTS4Base") +!5 = !DIFile(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 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, file: !5, scope: !"_ZTS4Base", baseType: !8) +!8 = !DIBasicType(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 = !DISubprogram(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 = !DIFile(filename: "bar.cpp", directory: "/Users/mren/c_testing/type_unique_air/simple") +!12 = !DISubroutineType(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 = !DISubprogram(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 = !DISubroutineType(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] -!19 = !MDLocation(line: 4, scope: !10) -!20 = !{!"0x100\00t\005\000", !10, !11, !4} ; [ DW_TAG_auto_variable ] [t] [line 5] -!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} +!18 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 4, arg: 1, scope: !10, file: !11, type: !8) +!19 = !DILocation(line: 4, scope: !10) +!20 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "t", line: 5, scope: !10, file: !11, type: !4) +!21 = !DILocation(line: 5, scope: !10) +!22 = !DILocation(line: 6, scope: !10) +!23 = !DILocation(line: 8, scope: !14) +!24 = !DILocation(line: 9, scope: !14) +!25 = !DILocation(line: 10, scope: !14) +!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 72a776bba0c1..f9170ab5f7fa 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 !DIExpression()), !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 !DIExpression()), !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,47 @@ 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 = !DICompileUnit(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 = !DIFile(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 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 2, size: 64, align: 64, file: !5, elements: !6, vtableHolder: !"_ZTS1A", identifier: "_ZTS1A") +!5 = !DIFile(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 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$A", size: 64, flags: DIFlagArtificial, file: !5, scope: !8, baseType: !9) +!8 = !DIFile(filename: "./ab.h", directory: "") +!9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, baseType: !10) +!10 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", size: 64, baseType: !11) +!11 = !DISubroutineType(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 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!14 = !DISubprogram(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") +!15 = !DISubroutineType(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] -!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 ] +!17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") +!19 = !DISubprogram(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") +!20 = !DISubroutineType(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", !""} -!25 = !{i32 786468} +!22 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !23) +!23 = !DIDerivedType(tag: DW_TAG_typedef, name: "foo_t", line: 1, file: !24, baseType: !13) +!24 = !DIFile(filename: "a.cpp", directory: "") !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 = !DISubprogram(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 = !DIFile(filename: "a.cpp", directory: "") +!29 = !DISubroutineType(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] -!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] +!31 = !DISubprogram(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 = !DISubprogram(name: "A", isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scope: !"_ZTS1A", type: !15) +!34 = !DISubprogram(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] -!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] -!45 = !MDLocation(line: 0, scope: !34) -!46 = !MDLocation(line: 2, scope: !34) +!38 = !DILocation(line: 3, scope: !27) +!39 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !31, type: !40) +!40 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1A") +!41 = !DILocation(line: 0, scope: !31) +!42 = !DILocation(line: 2, scope: !43) +!43 = !DILexicalBlockFile(discriminator: 0, file: !5, scope: !31) +!44 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !34, type: !40) +!45 = !DILocation(line: 0, scope: !34) +!46 = !DILocation(line: 2, scope: !34) diff --git a/test/Linker/type-unique-simple2-b.ll b/test/Linker/type-unique-simple2-b.ll index 25e67d424ea8..5539fb4adb35 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 !DIExpression()), !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 !DIExpression()), !dbg !37 + %this1 = load %class.A*, %class.A** %this.addr ret i32 1, !dbg !38 } @@ -47,42 +47,40 @@ 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 = !DICompileUnit(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 = !DIFile(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 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 2, size: 64, align: 64, file: !5, elements: !6, vtableHolder: !"_ZTS1A", identifier: "_ZTS1A") +!5 = !DIFile(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 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$A", size: 64, flags: DIFlagArtificial, file: !5, scope: !8, baseType: !9) +!8 = !DIFile(filename: "./ab.h", directory: "") +!9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, baseType: !10) +!10 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", size: 64, baseType: !11) +!11 = !DISubroutineType(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 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!14 = !DISubprogram(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") +!15 = !DISubroutineType(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] -!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 ] +!17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") +!19 = !DISubprogram(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") +!20 = !DISubroutineType(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] -!24 = !{i32 786468} +!22 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !23) +!23 = !DIDerivedType(tag: DW_TAG_typedef, name: "foo_t", line: 1, file: !5, baseType: !13) !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 = !DISubprogram(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 = !DIFile(filename: "b.cpp", directory: "") +!28 = !DISubprogram(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] -!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] -!37 = !MDLocation(line: 0, scope: !28) -!38 = !MDLocation(line: 4, scope: !28) +!32 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !26, type: !33) +!33 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1A") +!34 = !DILocation(line: 0, scope: !26) +!35 = !DILocation(line: 2, scope: !26) +!36 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !28, type: !33) +!37 = !DILocation(line: 0, scope: !28) +!38 = !DILocation(line: 4, scope: !28) diff --git a/test/Linker/type-unique-src-type.ll b/test/Linker/type-unique-src-type.ll index 01b33a21bd74..110ecc87e1b1 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 9e2de8821b4d..98c8d657743d 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 !DIExpression()), !dbg !25 + call void @llvm.dbg.declare(metadata %struct.SA* %sa, metadata !26, metadata !DIExpression()), !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 !DIExpression()), !dbg !31 + call void @llvm.dbg.declare(metadata %struct.SA* %a, metadata !32, metadata !DIExpression()), !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 = !DICompileUnit(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 = !DIFile(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 = !DICompositeType(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 = !DISubprogram(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 = !DISubroutineType(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 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") +!10 = !DICompositeType(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 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, file: !1, scope: !"_ZTS2SA", baseType: !13) +!13 = !DIBasicType(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 = !DISubprogram(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 = !DIFile(filename: "a.cpp", directory: "/Users/manmanren/test-Nov/type_unique/rdar_di_array") +!17 = !DISubroutineType(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 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1A") +!20 = !DISubprogram(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] -!25 = !MDLocation(line: 11, column: 14, scope: !15) -!26 = !{!"0x101\00sa\0033554443\000", !15, !16, !"_ZTS2SA"} ; [ DW_TAG_arg_variable ] [sa] [line 11] -!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] -!31 = !MDLocation(line: 0, scope: !20) -!32 = !{!"0x101\00a\0033554439\000", !20, !16, !"_ZTS2SA"} ; [ DW_TAG_arg_variable ] [a] [line 7] -!33 = !MDLocation(line: 7, column: 17, scope: !20) -!34 = !MDLocation(line: 8, column: 3, scope: !20) +!24 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 11, arg: 1, scope: !15, file: !16, type: !19) +!25 = !DILocation(line: 11, column: 14, scope: !15) +!26 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "sa", line: 11, arg: 2, scope: !15, file: !16, type: !"_ZTS2SA") +!27 = !DILocation(line: 11, column: 20, scope: !15) +!28 = !DILocation(line: 12, column: 3, scope: !15) +!29 = !DILocation(line: 13, column: 1, scope: !15) +!30 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !20, type: !19) +!31 = !DILocation(line: 0, scope: !20) +!32 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 7, arg: 2, scope: !20, file: !16, type: !"_ZTS2SA") +!33 = !DILocation(line: 7, column: 17, scope: !20) +!34 = !DILocation(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 0fdae2abfe92..14ce59b3c127 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 !DIExpression()), !dbg !25 + call void @llvm.dbg.declare(metadata %struct.SA* %sa, metadata !26, metadata !DIExpression()), !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 !DIExpression()), !dbg !31 + call void @llvm.dbg.declare(metadata %struct.SA* %sa, metadata !32, metadata !DIExpression()), !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 = !DICompileUnit(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 = !DIFile(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 = !DICompositeType(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 = !DISubprogram(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 = !DISubroutineType(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 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1B") +!10 = !DICompositeType(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 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, file: !1, scope: !"_ZTS2SA", baseType: !13) +!13 = !DIBasicType(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 = !DISubprogram(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 = !DIFile(filename: "b.cpp", directory: "/Users/manmanren/test-Nov/type_unique/rdar_di_array") +!17 = !DISubroutineType(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 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1B") +!20 = !DISubprogram(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] -!25 = !MDLocation(line: 11, column: 14, scope: !15) -!26 = !{!"0x101\00sa\0033554443\000", !15, !16, !"_ZTS2SA"} ; [ DW_TAG_arg_variable ] [sa] [line 11] -!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] -!31 = !MDLocation(line: 0, scope: !20) -!32 = !{!"0x101\00sa\0033554439\000", !20, !16, !"_ZTS2SA"} ; [ DW_TAG_arg_variable ] [sa] [line 7] -!33 = !MDLocation(line: 7, column: 17, scope: !20) -!34 = !MDLocation(line: 8, column: 3, scope: !20) +!24 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 11, arg: 1, scope: !15, file: !16, type: !19) +!25 = !DILocation(line: 11, column: 14, scope: !15) +!26 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "sa", line: 11, arg: 2, scope: !15, file: !16, type: !"_ZTS2SA") +!27 = !DILocation(line: 11, column: 20, scope: !15) +!28 = !DILocation(line: 12, column: 3, scope: !15) +!29 = !DILocation(line: 13, column: 1, scope: !15) +!30 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !20, type: !19) +!31 = !DILocation(line: 0, scope: !20) +!32 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "sa", line: 7, arg: 2, scope: !20, file: !16, type: !"_ZTS2SA") +!33 = !DILocation(line: 7, column: 17, scope: !20) +!34 = !DILocation(line: 8, column: 3, scope: !20) |