llvm.org GIT mirror llvm / 793a2b1
Make the default triple optional by allowing an empty string When building LLVM as a (potentially dynamic) library that can be linked against by multiple compilers, the default triple is not really meaningful. We allow to explicitely set it to an empty string when configuring LLVM. In this case, said "target independent" tests in the test suite that are using the default triple are disabled by matching the newly available feature "default_triple". Reviewers: probinson, echristo Differential Revision: http://reviews.llvm.org/D12660 From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247775 91177308-0d34-0410-b5e6-96231b3b80d8 Mehdi Amini 3 years ago
191 changed file(s) with 5994 addition(s) and 5962 deletion(s). Raw diff Collapse all Expand all
419419 /* Installation directory for data files */
420420 #cmakedefine LLVM_DATADIR "${LLVM_DATADIR}"
421421
422 /* Target triple LLVM will generate code for by default */
423 #cmakedefine LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}"
422 /* Target triple LLVM will generate code for by default
423 * Doesn't use `cmakedefine` because it is allowed to be empty.
424 */
425 #define LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}"
424426
425427 /* Installation directory for documentation */
426428 #cmakedefine LLVM_DOCSDIR "${LLVM_DOCSDIR}"
44 ; Test to make sure that arguments are removed from the function if they are
55 ; unnecessary. And clean up any types that frees up too.
66
7 ; CHECK: target triple
7 ; CHECK: ModuleID
88 ; CHECK-NOT: struct.anon
99 %struct.anon = type { i32 }
1010
None if 'native' not in config.available_features:
0 if not config.target_triple:
11 config.unsupported = True
22
0 ; RUN: llc < %s
1 ; REQUIRES: default_triple
12
23 define void @iterative_hash_host_wide_int() {
34 %zero = alloca i32 ; [#uses=2]
0 ; RUN: llc < %s
1 ; REQUIRES: default_triple
12
23 %struct..0anon = type { i32 }
34 %struct.rtx_def = type { i16, i8, i8, [1 x %struct..0anon] }
0 ; RUN: llc < %s -march=ppc64
11 ; RUN: llc < %s -march=ppc32
22 ; RUN: llc < %s
3 ; REQUIRES: default_triple
34
45 define void @bitap() {
56 entry:
0 ; RUN: llc < %s -march=ppc64
11 ; RUN: llc < %s -march=ppc32
22 ; RUN: llc < %s
3 ; REQUIRES: default_triple
34
45 @qsz.b = external global i1 ; [#uses=1]
56
11 ; RUN: llc < %s -march=ppc32 -mcpu=g3
22 ; RUN: llc < %s -march=ppc32 -mcpu=g5
33 ; PR1811
4 ; REQUIRES: default_triple
45
56 define void @execute_shader(<4 x float>* %OUT, <4 x float>* %IN, <4 x float>*
67 %CONST) {
0 ; RUN: llc < %s
1 ; REQUIRES: default_triple
12
23 ; This used to cause a crash. A standard load is converted to a pre-increment
34 ; load. Later the pre-increment load is combined with a subsequent SRL to
0 ; RUN: llc < %s
11 ; PR933
2 ; REQUIRES: default_triple
23
34 define fastcc i1 @test() {
45 ret i1 true
0 ; RUN: llc < %s
1 ; REQUIRES: default_triple
12
23 define <2 x i64> @_mm_insert_epi16(<2 x i64> %a, i32 %b, i32 %imm) nounwind readnone {
34 entry:
0 ; RUN: llc < %s
1 ; REQUIRES: default_triple
12
23 define <2 x i64> @_mm_movpi64_pi64(<1 x i64> %a, <1 x i64> %b) nounwind readnone {
34 entry:
0 ; RUN: llc -O1 < %s
1 ; REQUIRES: default_triple
2
13 ; ModuleID = 'pr6157.bc'
24 ; formerly crashed in SelectionDAGBuilder
35
0 ; RUN: llc -O0 -relocation-model pic < %s -o /dev/null
1 ; REQUIRES: default_triple
12 ; PR7545
23 @.str = private constant [4 x i8] c"one\00", align 1 ; <[4 x i8]*> [#uses=1]
34 @.str1 = private constant [4 x i8] c"two\00", align 1 ; <[5 x i8]*> [#uses=1]
0 ; RUN: llc < %s
1 ; REQUIRES: default_triple
12
23
34 declare i8* @llvm_gc_allocate(i32)
0 ; RUN: llc < %s -O0
1 ; REQUIRES: default_triple
12
23 define i32 @main() {
34 entry:
0 ; RUN: llc < %s
1 ; REQUIRES: default_triple
12
23 %Env = type i8*
34
0 ; RUN: llc < %s
1 ; REQUIRES: default_triple
12
23 ; Examples that exhibits a bug in DAGCombine. The case is triggered by the
34 ; following program. The bug is DAGCombine assumes that the bit convert
0 ; RUN: llc < %s
1 ; REQUIRES: default_triple
12
23 ; Legalization test that requires scalarizing a vector.
34
+0
-13
test/DebugInfo/2009-10-16-Phi.ll less more
None ; RUN: llvm-as %s -disable-output
1
2 define i32 @foo() {
3 E:
4 br label %B2
5 B1:
6 br label %B2
7 B2:
8 %0 = phi i32 [ 0, %E ], [ 1, %B1 ], !dbg !0
9 ret i32 %0
10 }
11
12 !0 = !{i32 42}
+0
-23
test/DebugInfo/2009-11-03-InsertExtractValue.ll less more
None ; RUN: llvm-as < %s | llvm-dis | FileCheck %s
1
2 !llvm.dbg.sp = !{!0}
3 !llvm.dbg.cu = !{!5}
4 !llvm.module.flags = !{!6}
5
6 !0 = !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEv", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagProtected | DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !4, scope: !1, type: !2)
7 !1 = !DIFile(filename: "/foo", directory: "bar.cpp")
8 !2 = !DISubroutineType(types: !3)
9 !3 = !{null}
10 !4 = !DIFile(filename: "/foo", directory: "bar.cpp")
11 !5 = distinct !DICompileUnit(language: DW_LANG_C99, isOptimized: true, emissionKind: 0, file: !4, enums: !{}, retainedTypes: !{})
12
13 define <{i32, i32}> @f1() {
14 ; CHECK: !dbgx ![[NUMBER:[0-9]+]]
15 %r = insertvalue <{ i32, i32 }> zeroinitializer, i32 4, 1, !dbgx !1
16 ; CHECK: !dbgx ![[NUMBER]]
17 %e = extractvalue <{ i32, i32 }> %r, 0, !dbgx !1
18 ret <{ i32, i32 }> %r
19 }
20
21 ; CHECK: DIFlagProtected
22 !6 = !{i32 1, !"Debug Info Version", i32 3}
+0
-26
test/DebugInfo/2009-11-05-DeadGlobalVariable.ll less more
None ; RUN: llc %s -o /dev/null
1 ; Here variable bar is optimized away. Do not trip over while trying to generate debug info.
2
3
4 define i32 @foo() nounwind uwtable readnone ssp {
5 entry:
6 ret i32 42, !dbg !15
7 }
8
9 !llvm.dbg.cu = !{!0}
10 !llvm.module.flags = !{!18}
11
12 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 139632)", isOptimized: true, emissionKind: 0, file: !17, enums: !1, retainedTypes: !1, subprograms: !3, globals: !12)
13 !1 = !{}
14 !3 = !{!5}
15 !5 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !17, scope: !6, type: !7, function: i32 ()* @foo)
16 !6 = !DIFile(filename: "fb.c", directory: "/private/tmp")
17 !7 = !DISubroutineType(types: !8)
18 !8 = !{!9}
19 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
20 !12 = !{!14}
21 !14 = !DIGlobalVariable(name: "bar", line: 2, isLocal: true, isDefinition: true, scope: !5, file: !6, type: !9)
22 !15 = !DILocation(line: 3, column: 3, scope: !16)
23 !16 = distinct !DILexicalBlock(line: 1, column: 11, file: !17, scope: !5)
24 !17 = !DIFile(filename: "fb.c", directory: "/private/tmp")
25 !18 = !{i32 1, !"Debug Info Version", i32 3}
+0
-14
test/DebugInfo/2009-11-06-NamelessGlobalVariable.ll less more
None ; RUN: llc %s -o /dev/null
1 @0 = internal constant i32 1
2
3 !llvm.dbg.cu = !{!0}
4 !llvm.module.flags = !{!9}
5
6 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 139632)", isOptimized: true, emissionKind: 0, file: !8, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3)
7 !2 = !{}
8 !3 = !{!5}
9 !5 = !DIGlobalVariable(name: "a", line: 2, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: i32* @0)
10 !6 = !DIFile(filename: "g.c", directory: "/private/tmp")
11 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
12 !8 = !DIFile(filename: "g.c", directory: "/private/tmp")
13 !9 = !{i32 1, !"Debug Info Version", i32 3}
+0
-31
test/DebugInfo/2009-11-10-CurrentFn.ll less more
None ; RUN: llc < %s -o /dev/null
1
2 define void @bar(i32 %i) nounwind uwtable ssp {
3 entry:
4 tail call void (...) @foo() nounwind, !dbg !14
5 ret void, !dbg !16
6 }
7
8 declare void @foo(...)
9
10 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
11
12 !llvm.dbg.cu = !{!0}
13 !llvm.module.flags = !{!18}
14
15 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 139632)", isOptimized: true, emissionKind: 0, file: !17, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1)
16 !1 = !{}
17 !3 = !{!5}
18 !5 = distinct !DISubprogram(name: "bar", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !17, scope: !6, type: !7, function: void (i32)* @bar, variables: !9)
19 !6 = !DIFile(filename: "cf.c", directory: "/private/tmp")
20 !7 = !DISubroutineType(types: !8)
21 !8 = !{null}
22 !9 = !{!11}
23 !11 = !DILocalVariable(name: "i", line: 3, arg: 1, scope: !5, file: !17, type: !12)
24 !12 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
25 !13 = !DILocation(line: 3, column: 14, scope: !5)
26 !14 = !DILocation(line: 4, column: 3, scope: !15)
27 !15 = distinct !DILexicalBlock(line: 3, column: 17, file: !17, scope: !5)
28 !16 = !DILocation(line: 5, column: 1, scope: !15)
29 !17 = !DIFile(filename: "cf.c", directory: "/private/tmp")
30 !18 = !{i32 1, !"Debug Info Version", i32 3}
+0
-25
test/DebugInfo/2010-01-05-DbgScope.ll less more
None ; RUN: llc < %s -o /dev/null
1 ; PR 5942
2 define i8* @foo() nounwind {
3 entry:
4 %0 = load i32, i32* undef, align 4, !dbg !0 ; [#uses=1]
5 %1 = inttoptr i32 %0 to i8*, !dbg !0 ; [#uses=1]
6 ret i8* %1, !dbg !10
7
8 }
9
10 !llvm.dbg.cu = !{!3}
11 !llvm.module.flags = !{!14}
12
13 !0 = !DILocation(line: 571, column: 3, scope: !1)
14 !1 = distinct !DILexicalBlock(line: 1, column: 1, file: !11, scope: !2)
15 !2 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 561, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scope: !3, type: !4)
16 !3 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang 1.1", isOptimized: true, emissionKind: 0, file: !11, enums: !12, retainedTypes: !12, subprograms: !13)
17 !4 = !DISubroutineType(types: !5)
18 !5 = !{!6}
19 !6 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
20 !10 = !DILocation(line: 588, column: 1, scope: !2)
21 !11 = !DIFile(filename: "hashtab.c", directory: "/usr/src/gnu/usr.bin/cc/cc_tools/../../../../contrib/gcclibs/libiberty")
22 !12 = !{}
23 !13 = !{!2}
24 !14 = !{i32 1, !"Debug Info Version", i32 3}
+0
-22
test/DebugInfo/2010-03-12-llc-crash.ll less more
None ; RUN: llc -O0 < %s -o /dev/null
1 ; llc should not crash on this optimized out debug info.
2 ; PR6588
3 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
4
5 define void @foo() {
6 entry:
7 call void @llvm.dbg.declare(metadata i32* undef, metadata !0, metadata !DIExpression()), !dbg !DILocation(scope: !1)
8 ret void
9 }
10
11 !0 = !DILocalVariable(name: "sy", line: 890, arg: 1, scope: !1, file: !2, type: !7)
12 !1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 892, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !8, scope: !3, type: !4)
13 !2 = !DIFile(filename: "qpainter.h", directory: "QtGui")
14 !3 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang 1.1", isOptimized: true, emissionKind: 0, file: !9, enums: !10, retainedTypes: !10)
15 !4 = !DISubroutineType(types: !6)
16 !5 = !DIFile(filename: "splineeditor.cpp", directory: "src")
17 !6 = !{null}
18 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
19 !8 = !DIFile(filename: "qpainter.h", directory: "QtGui")
20 !9 = !DIFile(filename: "splineeditor.cpp", directory: "src")
21 !10 = !{i32 0}
+0
-20
test/DebugInfo/2010-03-19-DbgDeclare.ll less more
None ; RUN: opt < %s -verify -S | FileCheck %s
1
2 ; CHECK: DW_LANG_Mips_Assembler
3
4 define void @Foo(i32 %a, i32 %b) {
5 entry:
6 call void @llvm.dbg.declare(metadata i32* null, metadata !1, metadata !DIExpression()), !dbg !DILocation(scope: !6)
7 ret void
8 }
9 !llvm.dbg.cu = !{!2}
10 !llvm.module.flags = !{!5}
11 !2 = distinct !DICompileUnit(language: DW_LANG_Mips_Assembler, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 1, file: !4, enums: !3, retainedTypes: !3, subprograms: !3, globals: !3, imports: !3)
12 !3 = !{}
13 !0 = !DILocation(line: 662302, column: 26, scope: !1)
14 !1 = !DILocalVariable(name: "foo", scope: !6)
15 !4 = !DIFile(filename: "scratch.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
16 !6 = distinct !DISubprogram()
17
18 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
19 !5 = !{i32 1, !"Debug Info Version", i32 3}
+0
-70
test/DebugInfo/2010-03-24-MemberFn.ll less more
None ; RUN: %llc_dwarf -O0 < %s | grep AT_decl_file | grep 2
1 ; Here _ZN1S3fooEv is defined in header file identified as AT_decl_file no. 2 in debug info.
2 %struct.S = type <{ i8 }>
3
4 define i32 @_Z3barv() nounwind ssp {
5 entry:
6 %retval = alloca i32 ; [#uses=2]
7 %0 = alloca i32 ; [#uses=2]
8 %s1 = alloca %struct.S ; <%struct.S*> [#uses=1]
9 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
10 call void @llvm.dbg.declare(metadata %struct.S* %s1, metadata !0, metadata !DIExpression()), !dbg !16
11 %1 = call i32 @_ZN1S3fooEv(%struct.S* %s1) nounwind, !dbg !17 ; [#uses=1]
12 store i32 %1, i32* %0, align 4, !dbg !17
13 %2 = load i32, i32* %0, align 4, !dbg !17 ; [#uses=1]
14 store i32 %2, i32* %retval, align 4, !dbg !17
15 br label %return, !dbg !17
16
17 return: ; preds = %entry
18 %retval1 = load i32, i32* %retval, !dbg !17 ; [#uses=1]
19 ret i32 %retval1, !dbg !16
20 }
21
22 define linkonce_odr i32 @_ZN1S3fooEv(%struct.S* %this) nounwind ssp align 2 {
23 entry:
24 %this_addr = alloca %struct.S* ; <%struct.S**> [#uses=1]
25 %retval = alloca i32 ; [#uses=1]
26 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
27 call void @llvm.dbg.declare(metadata %struct.S** %this_addr, metadata !18, metadata !DIExpression()), !dbg !21
28 store %struct.S* %this, %struct.S** %this_addr
29 br label %return, !dbg !21
30
31 return: ; preds = %entry
32 %retval1 = load i32, i32* %retval, !dbg !21 ; [#uses=1]
33 ret i32 %retval1, !dbg !22
34 }
35
36 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
37
38 !llvm.dbg.cu = !{!5}
39 !llvm.module.flags = !{!28}
40
41 !0 = !DILocalVariable(name: "s1", line: 3, scope: !1, file: !4, type: !9)
42 !1 = distinct !DILexicalBlock(line: 3, column: 0, file: !25, scope: !2)
43 !2 = distinct !DILexicalBlock(line: 3, column: 0, file: !25, scope: !3)
44 !3 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 3, file: !25, scope: !4, type: !6, function: i32 ()* @_Z3barv)
45 !4 = !DIFile(filename: "one.cc", directory: "/tmp/")
46 !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !25, enums: !27, retainedTypes: !27, subprograms: !24, imports: null)
47 !6 = !DISubroutineType(types: !7)
48 !7 = !{!8}
49 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
50 !9 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", line: 2, size: 8, align: 8, file: !26, scope: !4, elements: !11)
51 !10 = !DIFile(filename: "one.h", directory: "/tmp/")
52 !11 = !{!12}
53 !12 = distinct !DISubprogram(name: "foo", linkageName: "_ZN1S3fooEv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 3, file: !26, scope: !9, type: !13, function: i32 (%struct.S*)* @_ZN1S3fooEv)
54 !13 = !DISubroutineType(types: !14)
55 !14 = !{!8, !15}
56 !15 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, file: !25, scope: !4, baseType: !9)
57 !16 = !DILocation(line: 3, scope: !1)
58 !17 = !DILocation(line: 3, scope: !3)
59 !18 = !DILocalVariable(name: "this", line: 3, arg: 1, scope: !12, file: !10, type: !19)
60 !19 = !DIDerivedType(tag: DW_TAG_const_type, size: 64, align: 64, flags: DIFlagArtificial, file: !25, scope: !4, baseType: !20)
61 !20 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !25, scope: !4, baseType: !9)
62 !21 = !DILocation(line: 3, scope: !12)
63 !22 = !DILocation(line: 3, scope: !23)
64 !23 = distinct !DILexicalBlock(line: 3, column: 0, file: !26, scope: !12)
65 !24 = !{!3, !12}
66 !25 = !DIFile(filename: "one.cc", directory: "/tmp/")
67 !26 = !DIFile(filename: "one.h", directory: "/tmp/")
68 !27 = !{}
69 !28 = !{i32 1, !"Debug Info Version", i32 3}
+0
-112
test/DebugInfo/2010-04-06-NestedFnDbgInfo.ll less more
None ; REQUIRES: object-emission
1
2 ; RUN: %llc_dwarf -O0 -filetype=obj -o - < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
3 ; Radar 7833483
4 ; Do not emit a separate out-of-line definition DIE for the function-local 'foo'
5 ; function (member of the function local 'A' type)
6 ; CHECK: DW_TAG_class_type
7 ; CHECK: DW_TAG_class_type
8 ; CHECK-NEXT: DW_AT_name {{.*}} "A"
9 ; Check that the subprogram inside the class definition has low_pc, only
10 ; attached to the definition.
11 ; CHECK: [[FOO_INL:0x........]]: DW_TAG_subprogram
12 ; CHECK-NOT: DW_TAG
13 ; CHECK: DW_AT_low_pc
14 ; CHECK-NOT: DW_TAG
15 ; CHECK: DW_AT_name {{.*}} "foo"
16 ; And just double check that there's no out of line definition that references
17 ; this subprogram.
18 ; CHECK-NOT: DW_AT_specification {{.*}} {[[FOO_INL]]}
19
20 %class.A = type { i8 }
21 %class.B = type { i8 }
22
23 define i32 @main() ssp {
24 entry:
25 %retval = alloca i32, align 4 ; [#uses=3]
26 %b = alloca %class.A, align 1 ; <%class.A*> [#uses=1]
27 store i32 0, i32* %retval
28 call void @llvm.dbg.declare(metadata %class.A* %b, metadata !0, metadata !DIExpression()), !dbg !14
29 %call = call i32 @_ZN1B2fnEv(%class.A* %b), !dbg !15 ; [#uses=1]
30 store i32 %call, i32* %retval, !dbg !15
31 %0 = load i32, i32* %retval, !dbg !16 ; [#uses=1]
32 ret i32 %0, !dbg !16
33 }
34
35 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
36
37 define linkonce_odr i32 @_ZN1B2fnEv(%class.A* %this) ssp align 2 {
38 entry:
39 %retval = alloca i32, align 4 ; [#uses=2]
40 %this.addr = alloca %class.A*, align 8 ; <%class.A**> [#uses=2]
41 %a = alloca %class.A, align 1 ; <%class.A*> [#uses=1]
42 %i = alloca i32, align 4 ; [#uses=2]
43 store %class.A* %this, %class.A** %this.addr
44 call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !17, metadata !DIExpression()), !dbg !18
45 %this1 = load %class.A*, %class.A** %this.addr ; <%class.A*> [#uses=0]
46 call void @llvm.dbg.declare(metadata %class.A* %a, metadata !19, metadata !DIExpression()), !dbg !27
47 call void @llvm.dbg.declare(metadata i32* %i, metadata !28, metadata !DIExpression()), !dbg !29
48 %call = call i32 @_ZZN1B2fnEvEN1A3fooEv(%class.A* %a), !dbg !30 ; [#uses=1]
49 store i32 %call, i32* %i, !dbg !30
50 %tmp = load i32, i32* %i, !dbg !31 ; [#uses=1]
51 store i32 %tmp, i32* %retval, !dbg !31
52 %0 = load i32, i32* %retval, !dbg !32 ; [#uses=1]
53 ret i32 %0, !dbg !32
54 }
55
56 define internal i32 @_ZZN1B2fnEvEN1A3fooEv(%class.A* %this) ssp align 2 {
57 entry:
58 %retval = alloca i32, align 4 ; [#uses=2]
59 %this.addr = alloca %class.A*, align 8 ; <%class.A**> [#uses=2]
60 store %class.A* %this, %class.A** %this.addr
61 call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !33, metadata !DIExpression()), !dbg !34
62 %this1 = load %class.A*, %class.A** %this.addr ; <%class.A*> [#uses=0]
63 store i32 42, i32* %retval, !dbg !35
64 %0 = load i32, i32* %retval, !dbg !35 ; [#uses=1]
65 ret i32 %0, !dbg !35
66 }
67
68 !llvm.dbg.cu = !{!4}
69 !llvm.module.flags = !{!40}
70 !37 = !{!2, !10, !23}
71
72 !0 = !DILocalVariable(name: "b", line: 16, scope: !1, file: !3, type: !8)
73 !1 = distinct !DILexicalBlock(line: 15, column: 12, file: !38, scope: !2)
74 !2 = distinct !DISubprogram(name: "main", linkageName: "main", line: 15, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 15, file: !38, scope: !3, type: !5, function: i32 ()* @main)
75 !3 = !DIFile(filename: "one.cc", directory: "/tmp")
76 !4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang 1.5", isOptimized: false, emissionKind: 0, file: !38, enums: !39, retainedTypes: !39, subprograms: !37, imports: null)
77 !5 = !DISubroutineType(types: !6)
78 !6 = !{!7}
79 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
80 !8 = !DICompositeType(tag: DW_TAG_class_type, name: "B", line: 2, size: 8, align: 8, file: !38, scope: !3, elements: !9)
81 !9 = !{!10}
82 !10 = distinct !DISubprogram(name: "fn", linkageName: "_ZN1B2fnEv", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 4, file: !38, scope: !8, type: !11, function: i32 (%class.A*)* @_ZN1B2fnEv)
83 !11 = !DISubroutineType(types: !12)
84 !12 = !{!7, !13}
85 !13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, file: !38, scope: !3, baseType: !8)
86 !14 = !DILocation(line: 16, column: 5, scope: !1)
87 !15 = !DILocation(line: 17, column: 3, scope: !1)
88 !16 = !DILocation(line: 18, column: 1, scope: !2)
89 !17 = !DILocalVariable(name: "this", line: 4, arg: 1, scope: !10, file: !3, type: !13)
90 !18 = !DILocation(line: 4, column: 7, scope: !10)
91 !19 = !DILocalVariable(name: "a", line: 9, scope: !20, file: !3, type: !21)
92 !20 = distinct !DILexicalBlock(line: 4, column: 12, file: !38, scope: !10)
93 !21 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 5, size: 8, align: 8, file: !38, scope: !10, elements: !22)
94 !22 = !{!23}
95 !23 = distinct !DISubprogram(name: "foo", linkageName: "_ZZN1B2fnEvEN1A3fooEv", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 7, file: !38, scope: !21, type: !24, function: i32 (%class.A*)* @_ZZN1B2fnEvEN1A3fooEv)
96 !24 = !DISubroutineType(types: !25)
97 !25 = !{!7, !26}
98 !26 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, file: !38, scope: !3, baseType: !21)
99 !27 = !DILocation(line: 9, column: 7, scope: !20)
100 !28 = !DILocalVariable(name: "i", line: 10, scope: !20, file: !3, type: !7)
101 !29 = !DILocation(line: 10, column: 9, scope: !20)
102 !30 = !DILocation(line: 10, column: 5, scope: !20)
103 !31 = !DILocation(line: 11, column: 5, scope: !20)
104 !32 = !DILocation(line: 12, column: 3, scope: !10)
105 !33 = !DILocalVariable(name: "this", line: 7, arg: 1, scope: !23, file: !3, type: !26)
106 !34 = !DILocation(line: 7, column: 11, scope: !23)
107 !35 = !DILocation(line: 7, column: 19, scope: !36)
108 !36 = distinct !DILexicalBlock(line: 7, column: 17, file: !38, scope: !23)
109 !38 = !DIFile(filename: "one.cc", directory: "/tmp")
110 !39 = !{}
111 !40 = !{i32 1, !"Debug Info Version", i32 3}
+0
-37
test/DebugInfo/2010-04-19-FramePtr.ll less more
None ; RUN: %llc_dwarf -asm-verbose -O1 -o %t < %s
1 ; RUN: grep DW_AT_APPLE_omit_frame_ptr %t
2 ; RUN: %llc_dwarf -disable-fp-elim -asm-verbose -O1 -o %t < %s
3 ; RUN: grep -v DW_AT_APPLE_omit_frame_ptr %t
4
5
6 define i32 @foo() nounwind ssp {
7 entry:
8 %retval = alloca i32 ; [#uses=2]
9 %0 = alloca i32 ; [#uses=2]
10 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
11 store i32 42, i32* %0, align 4, !dbg !0
12 %1 = load i32, i32* %0, align 4, !dbg !0 ; [#uses=1]
13 store i32 %1, i32* %retval, align 4, !dbg !0
14 br label %return, !dbg !0
15
16 return: ; preds = %entry
17 %retval1 = load i32, i32* %retval, !dbg !0 ; [#uses=1]
18 ret i32 %retval1, !dbg !7
19 }
20
21 !llvm.dbg.cu = !{!3}
22 !llvm.module.flags = !{!12}
23 !9 = !{!1}
24
25 !0 = !DILocation(line: 2, scope: !1)
26 !1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !10, scope: null, type: !4, function: i32 ()* @foo)
27 !2 = !DIFile(filename: "a.c", directory: "/tmp")
28 !3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !10, enums: !11, retainedTypes: !11, subprograms: !9, imports: null)
29 !4 = !DISubroutineType(types: !5)
30 !5 = !{!6}
31 !6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
32 !7 = !DILocation(line: 2, scope: !8)
33 !8 = distinct !DILexicalBlock(line: 2, column: 0, file: !10, scope: !1)
34 !10 = !DIFile(filename: "a.c", directory: "/tmp")
35 !11 = !{}
36 !12 = !{i32 1, !"Debug Info Version", i32 3}
+0
-40
test/DebugInfo/2010-05-03-DisableFramePtr.ll less more
None ; RUN: llc -o /dev/null < %s
1 ; Radar 7937664
2 %struct.AppleEvent = type opaque
3
4 define void @DisposeDMNotificationUPP(void (%struct.AppleEvent*)* %userUPP) "no-frame-pointer-elim-non-leaf" nounwind ssp {
5 entry:
6 %userUPP_addr = alloca void (%struct.AppleEvent*)* ; [#uses=1]
7 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
8 call void @llvm.dbg.declare(metadata void (%struct.AppleEvent*)** %userUPP_addr, metadata !0, metadata !DIExpression()), !dbg !13
9 store void (%struct.AppleEvent*)* %userUPP, void (%struct.AppleEvent*)** %userUPP_addr
10 br label %return, !dbg !14
11
12 return: ; preds = %entry
13 ret void, !dbg !14
14 }
15
16 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
17
18 !llvm.dbg.cu = !{!3}
19 !llvm.module.flags = !{!19}
20 !0 = !DILocalVariable(name: "userUPP", line: 7, arg: 1, scope: !1, file: !2, type: !6)
21 !1 = distinct !DISubprogram(name: "DisposeDMNotificationUPP", linkageName: "DisposeDMNotificationUPP", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !16, scope: null, type: !4)
22 !2 = !DIFile(filename: "t.c", directory: "/Users/echeng/LLVM/radars/r7937664/")
23 !3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build 9999)", isOptimized: true, emissionKind: 0, file: !16, enums: !17, retainedTypes: !17, subprograms: !18)
24 !4 = !DISubroutineType(types: !5)
25 !5 = !{null, !6}
26 !6 = !DIDerivedType(tag: DW_TAG_typedef, name: "DMNotificationUPP", line: 6, file: !16, scope: !2, baseType: !7)
27 !7 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !16, scope: !2, baseType: !8)
28 !8 = !DISubroutineType(types: !9)
29 !9 = !{null, !10}
30 !10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !16, scope: !2, baseType: !11)
31 !11 = !DIDerivedType(tag: DW_TAG_typedef, name: "AppleEvent", line: 4, file: !16, scope: !2, baseType: !12)
32 !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "AEDesc", line: 1, flags: DIFlagFwdDecl, file: !16, scope: !2)
33 !13 = !DILocation(line: 7, scope: !1)
34 !14 = !DILocation(line: 8, scope: !15)
35 !15 = distinct !DILexicalBlock(line: 7, column: 0, file: !16, scope: !1)
36 !16 = !DIFile(filename: "t.c", directory: "/Users/echeng/LLVM/radars/r7937664/")
37 !17 = !{}
38 !18 = !{!1}
39 !19 = !{i32 1, !"Debug Info Version", i32 3}
+0
-94
test/DebugInfo/2010-05-03-OriginDIE.ll less more
None
1 ;RUN: llc < %s -o /dev/null
2 ;Radar 7937109
3
4 %struct.anon = type { i64, i32, i32, i32, [1 x i32] }
5 %struct.gpm_t = type { i32, i8*, [16 x i8], i32, i64, i64, i64, i64, i64, i64, i32, i16, i16, [8 x %struct.gpmr_t] }
6 %struct.gpmr_t = type { [48 x i8], [48 x i8], [16 x i8], i64, i64, i64, i64, i16 }
7 %struct.gpt_t = type { [8 x i8], i32, i32, i32, i32, i64, i64, i64, i64, [16 x i8], %struct.anon }
8
9 @llvm.used = appending global [1 x i8*] [i8* bitcast (void (%struct.gpm_t*, %struct.gpt_t*)* @gpt2gpm to i8*)], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0]
10
11 define fastcc void @gpt2gpm(%struct.gpm_t* %gpm, %struct.gpt_t* %gpt) nounwind optsize ssp {
12 entry:
13 %data_addr.i18 = alloca i64, align 8 ; [#uses=1]
14 %data_addr.i17 = alloca i64, align 8 ; [#uses=2]
15 %data_addr.i16 = alloca i64, align 8 ; [#uses=0]
16 %data_addr.i15 = alloca i32, align 4 ; [#uses=0]
17 %data_addr.i = alloca i64, align 8 ; [#uses=0]
18 %0 = getelementptr inbounds %struct.gpm_t, %struct.gpm_t* %gpm, i32 0, i32 2, i32 0 ; [#uses=1]
19 %1 = getelementptr inbounds %struct.gpt_t, %struct.gpt_t* %gpt, i32 0, i32 9, i32 0 ; [#uses=1]
20 call void @uuid_LtoB(i8* %0, i8* %1) nounwind, !dbg !0
21 %a9 = load volatile i64, i64* %data_addr.i18, align 8 ; [#uses=1]
22 %a10 = call i64 @llvm.bswap.i64(i64 %a9) nounwind ; [#uses=1]
23 %a11 = getelementptr inbounds %struct.gpt_t, %struct.gpt_t* %gpt, i32 0, i32 8, !dbg !7 ; [#uses=1]
24 %a12 = load i64, i64* %a11, align 4, !dbg !7 ; [#uses=1]
25 call void @llvm.dbg.declare(metadata i64* %data_addr.i17, metadata !8, metadata !DIExpression()) nounwind, !dbg !14
26 store i64 %a12, i64* %data_addr.i17, align 8
27 call void @llvm.dbg.value(metadata !6, i64 0, metadata !15, metadata !DIExpression()) nounwind, !dbg !DILocation(scope: !16)
28 call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !19, metadata !DIExpression()) nounwind, !dbg !DILocation(scope: !16)
29 call void @llvm.dbg.declare(metadata !6, metadata !23, metadata !DIExpression()) nounwind, !dbg !DILocation(scope: !24)
30 call void @llvm.dbg.value(metadata i64* %data_addr.i17, i64 0, metadata !34, metadata !DIExpression()) nounwind, !dbg !DILocation(scope: !24)
31 %a13 = load volatile i64, i64* %data_addr.i17, align 8 ; [#uses=1]
32 %a14 = call i64 @llvm.bswap.i64(i64 %a13) nounwind ; [#uses=2]
33 %a15 = add i64 %a10, %a14, !dbg !7 ; [#uses=1]
34 %a16 = sub i64 %a15, %a14 ; [#uses=1]
35 %a17 = getelementptr inbounds %struct.gpm_t, %struct.gpm_t* %gpm, i32 0, i32 5, !dbg !7 ; [#uses=1]
36 store i64 %a16, i64* %a17, align 4, !dbg !7
37 ret void, !dbg !7
38 }
39
40 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
41
42 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
43
44 declare i32 @llvm.bswap.i32(i32) nounwind readnone
45
46 declare i64 @llvm.bswap.i64(i64) nounwind readnone
47
48 declare void @uuid_LtoB(i8*, i8*)
49
50 !llvm.dbg.cu = !{!4}
51 !llvm.module.flags = !{!41}
52 !0 = !DILocation(line: 808, scope: !1)
53 !1 = distinct !DILexicalBlock(line: 807, column: 0, file: !39, scope: !2)
54 !2 = distinct !DISubprogram(name: "gpt2gpm", linkageName: "gpt2gpm", line: 807, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !39, scope: null, type: !5)
55 !3 = !DIFile(filename: "G.c", directory: "/tmp")
56 !4 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "llvm-gcc", isOptimized: true, emissionKind: 0, file: !39, enums: !18, retainedTypes: !18, subprograms: !40)
57 !5 = !DISubroutineType(types: !6)
58 !6 = !{null}
59 !7 = !DILocation(line: 810, scope: !1)
60 !8 = !DILocalVariable(name: "data", line: 201, arg: 1, scope: !9, file: !10, type: !11)
61 !9 = distinct !DISubprogram(name: "_OSSwapInt64", linkageName: "_OSSwapInt64", line: 202, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !10, scope: null, type: !5)
62 !10 = !DIFile(filename: "OSByteOrder.h", directory: "/usr/include/libkern/ppc")
63 !11 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint64_t", line: 59, file: !36, scope: !3, baseType: !13)
64 !12 = !DIFile(filename: "stdint.h", directory: "/usr/4.2.1/include")
65 !13 = !DIBasicType(tag: DW_TAG_base_type, name: "long long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned)
66 !14 = !DILocation(line: 202, scope: !9, inlinedAt: !7)
67 !15 = !DILocalVariable(name: "base", line: 92, arg: 2, scope: !16, file: !10, type: !17)
68 !16 = distinct !DISubprogram(name: "OSReadSwapInt64", linkageName: "OSReadSwapInt64", line: 95, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !38, scope: null, type: !5)
69 !17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !39, scope: !3, baseType: null)
70 !18 = !{}
71 !19 = !DILocalVariable(name: "byteOffset", line: 94, arg: 3, scope: !16, file: !10, type: !20)
72 !20 = !DIDerivedType(tag: DW_TAG_typedef, name: "uintptr_t", line: 114, file: !37, scope: !3, baseType: !22)
73 !21 = !DIFile(filename: "types.h", directory: "/usr/include/ppc")
74 !22 = !DIBasicType(tag: DW_TAG_base_type, name: "long unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)
75 !23 = !DILocalVariable(name: "u", line: 100, scope: !24, file: !10, type: !25)
76 !24 = distinct !DILexicalBlock(line: 95, column: 0, file: !38, scope: !16)
77 !25 = !DICompositeType(tag: DW_TAG_union_type, line: 97, size: 64, align: 64, file: !38, scope: !16, elements: !26)
78 !26 = !{!27, !28}
79 !27 = !DIDerivedType(tag: DW_TAG_member, name: "u64", line: 98, size: 64, align: 64, file: !38, scope: !25, baseType: !11)
80 !28 = !DIDerivedType(tag: DW_TAG_member, name: "u32", line: 99, size: 64, align: 32, file: !38, scope: !25, baseType: !29)
81 !29 = !DICompositeType(tag: DW_TAG_array_type, size: 64, align: 32, file: !39, scope: !3, baseType: !30, elements: !32)
82 !30 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint32_t", line: 55, file: !36, scope: !3, baseType: !31)
83 !31 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)
84 !32 = !{!33}
85 !33 = !DISubrange(count: 2)
86 !34 = !DILocalVariable(name: "addr", line: 96, scope: !24, file: !10, type: !35)
87 !35 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !39, scope: !3, baseType: !11)
88 !36 = !DIFile(filename: "stdint.h", directory: "/usr/4.2.1/include")
89 !37 = !DIFile(filename: "types.h", directory: "/usr/include/ppc")
90 !38 = !DIFile(filename: "OSByteOrder.h", directory: "/usr/include/libkern/ppc")
91 !39 = !DIFile(filename: "G.c", directory: "/tmp")
92 !40 = !{!2, !9, !16}
93 !41 = !{i32 1, !"Debug Info Version", i32 3}
+0
-44
test/DebugInfo/2010-05-10-MultipleCU.ll less more
None ; REQUIRES: object-emission
1
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
3
4 ; Check that two compile units are generated
5
6 ; CHECK: Compile Unit:
7 ; CHECK: Compile Unit:
8
9 define i32 @foo() nounwind readnone ssp {
10 return:
11 ret i32 42, !dbg !0
12 }
13
14 define i32 @bar() nounwind readnone ssp {
15 return:
16 ret i32 21, !dbg !8
17 }
18
19 !llvm.dbg.cu = !{!4, !12}
20 !llvm.module.flags = !{!21}
21 !16 = !{!2}
22 !17 = !{!10}
23
24 !0 = !DILocation(line: 3, scope: !1)
25 !1 = distinct !DILexicalBlock(line: 2, column: 0, file: !18, scope: !2)
26 !2 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !18, scope: !3, type: !5, function: i32 ()* @foo)
27 !3 = !DIFile(filename: "a.c", directory: "/tmp/")
28 !4 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !18, enums: !19, retainedTypes: !19, subprograms: !16)
29 !5 = !DISubroutineType(types: !6)
30 !6 = !{!7}
31 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
32 !8 = !DILocation(line: 3, scope: !9)
33 !9 = distinct !DILexicalBlock(line: 2, column: 0, file: !20, scope: !10)
34 !10 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !20, scope: !11, type: !13, function: i32 ()* @bar)
35 !11 = !DIFile(filename: "b.c", directory: "/tmp/")
36 !12 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !20, enums: !19, retainedTypes: !19, subprograms: !17)
37 !13 = !DISubroutineType(types: !14)
38 !14 = !{!15}
39 !15 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
40 !18 = !DIFile(filename: "a.c", directory: "/tmp/")
41 !19 = !{}
42 !20 = !DIFile(filename: "b.c", directory: "/tmp/")
43 !21 = !{i32 1, !"Debug Info Version", i32 3}
+0
-61
test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll less more
None ; RUN: %llc_dwarf -O2 %s -o - | FileCheck %s
1 ; Check struct X for dead variable xyz from inlined function foo.
2
3 ; CHECK: section_info
4 ; CHECK: DW_TAG_structure_type
5 ; CHECK-NEXT: DW_AT_name
6
7
8 @i = common global i32 0 ; [#uses=2]
9
10 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
11
12 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
13
14 define i32 @bar() nounwind ssp {
15 entry:
16 %0 = load i32, i32* @i, align 4, !dbg !17 ; [#uses=2]
17 tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !59, metadata !DIExpression()), !dbg !19
18 tail call void @llvm.dbg.declare(metadata !29, metadata !60, metadata !DIExpression()), !dbg !21
19 %1 = mul nsw i32 %0, %0, !dbg !22 ; [#uses=2]
20 store i32 %1, i32* @i, align 4, !dbg !17
21 ret i32 %1, !dbg !23
22 }
23
24 !llvm.dbg.cu = !{!2}
25 !llvm.module.flags = !{!28}
26
27 !0 = distinct !DISubprogram(name: "foo", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 9, file: !27, scope: !1, type: !3, variables: !24)
28 !1 = !DIFile(filename: "bar.c", directory: "/tmp/")
29 !2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !20, subprograms: !25, globals: !26, imports: !20)
30 !3 = !DISubroutineType(types: !4)
31 !4 = !{!5, !5}
32 !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
33 !6 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !27, scope: !1, type: !7, function: i32 ()* @bar)
34 !7 = !DISubroutineType(types: !8)
35 !8 = !{!5}
36 !9 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5)
37 !10 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12)
38
39 !59 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5)
40 !60 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12)
41
42 !11 = distinct !DILexicalBlock(line: 9, column: 0, file: !1, scope: !0)
43 !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", line: 10, size: 64, align: 32, file: !27, scope: !0, elements: !13)
44 !13 = !{!14, !15}
45 !14 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 10, size: 32, align: 32, file: !27, scope: !12, baseType: !5)
46 !15 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 10, size: 32, align: 32, offset: 32, file: !27, scope: !12, baseType: !5)
47 !16 = !DIGlobalVariable(name: "i", line: 5, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !5, variable: i32* @i)
48 !17 = !DILocation(line: 15, scope: !18)
49 !18 = distinct !DILexicalBlock(line: 14, column: 0, file: !1, scope: !6)
50 !19 = !DILocation(line: 9, scope: !0, inlinedAt: !17)
51 !20 = !{}
52 !21 = !DILocation(line: 9, scope: !11, inlinedAt: !17)
53 !22 = !DILocation(line: 11, scope: !11, inlinedAt: !17)
54 !23 = !DILocation(line: 16, scope: !18)
55 !24 = !{!9, !10}
56 !25 = !{!0, !6}
57 !26 = !{!16}
58 !27 = !DIFile(filename: "bar.c", directory: "/tmp/")
59 !28 = !{i32 1, !"Debug Info Version", i32 3}
60 !29 = !{null}
+0
-30
test/DebugInfo/2010-07-19-Crash.ll less more
None ; RUN: llc -o /dev/null < %s
1 ; PR7662
2 ; Do not add variables to !11 because it is a declaration entry.
3
4 define i32 @bar() nounwind readnone ssp {
5 entry:
6 ret i32 42, !dbg !9
7 }
8
9 !llvm.dbg.cu = !{!2}
10 !llvm.module.flags = !{!15}
11 !llvm.dbg.sp = !{!0, !6, !11}
12 !llvm.dbg.lv.foo = !{!7}
13
14 !0 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !12, scope: !1, type: !3, function: i32 ()* @bar)
15 !1 = !DIFile(filename: "one.c", directory: "/private/tmp")
16 !2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang 2.8", isOptimized: true, emissionKind: 0, file: !12, enums: !14, retainedTypes: !14, subprograms: !13)
17 !3 = !DISubroutineType(types: !4)
18 !4 = !{!5}
19 !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
20 !6 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 7, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !12, scope: !1, type: !3)
21 !7 = !DILocalVariable(name: "one", line: 8, scope: !8, file: !1, type: !5)
22 !8 = distinct !DILexicalBlock(line: 7, column: 18, file: !12, scope: !6)
23 !9 = !DILocation(line: 4, column: 3, scope: !10)
24 !10 = distinct !DILexicalBlock(line: 3, column: 11, file: !12, scope: !0)
25 !11 = !DISubprogram(name: "foo", linkageName: "foo", line: 7, isLocal: true, isDefinition: false, virtualIndex: 6, isOptimized: true, file: !12, scope: !1, type: !3)
26 !12 = !DIFile(filename: "one.c", directory: "/private/tmp")
27 !13 = !{!0}
28 !14 = !{}
29 !15 = !{i32 1, !"Debug Info Version", i32 3}
+0
-24
test/DebugInfo/2010-10-01-crash.ll less more
None ; RUN: llc -O0 %s -o /dev/null
1
2 define void @CGRectStandardize(i32* sret %agg.result, i32* byval %rect) nounwind ssp {
3 entry:
4 call void @llvm.dbg.declare(metadata i32* %rect, metadata !23, metadata !DIExpression()), !dbg !24
5 ret void
6 }
7
8 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
9
10 declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
11
12
13 !llvm.dbg.cu = !{!2}
14 !llvm.module.flags = !{!27}
15 !0 = distinct !DISubprogram(name: "CGRectStandardize", linkageName: "CGRectStandardize", line: 54, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !1, scope: null, function: void (i32*, i32*)* @CGRectStandardize)
16 !1 = !DIFile(filename: "GSFusedSilica.m", directory: "/Volumes/Data/Users/sabre/Desktop")
17 !2 = distinct !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 2.9 (trunk 115292)", isOptimized: true, runtimeVersion: 1, emissionKind: 0, file: !25, enums: !26, retainedTypes: !26, subprograms: !{!0})
18 !5 = !DIDerivedType(tag: DW_TAG_typedef, name: "CGRect", line: 49, file: !25, baseType: null)
19 !23 = !DILocalVariable(name: "rect", line: 53, arg: 2, scope: !0, file: !1, type: !5)
20 !24 = !DILocation(line: 53, column: 33, scope: !0)
21 !25 = !DIFile(filename: "GSFusedSilica.m", directory: "/Volumes/Data/Users/sabre/Desktop")
22 !26 = !{}
23 !27 = !{i32 1, !"Debug Info Version", i32 3}
0 ; RUN: llvm-as %s -disable-output
1
2 define i32 @foo() {
3 E:
4 br label %B2
5 B1:
6 br label %B2
7 B2:
8 %0 = phi i32 [ 0, %E ], [ 1, %B1 ], !dbg !0
9 ret i32 %0
10 }
11
12 !0 = !{i32 42}
0 ; RUN: llvm-as < %s | llvm-dis | FileCheck %s
1
2 !llvm.dbg.sp = !{!0}
3 !llvm.dbg.cu = !{!5}
4 !llvm.module.flags = !{!6}
5
6 !0 = !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEv", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagProtected | DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !4, scope: !1, type: !2)
7 !1 = !DIFile(filename: "/foo", directory: "bar.cpp")
8 !2 = !DISubroutineType(types: !3)
9 !3 = !{null}
10 !4 = !DIFile(filename: "/foo", directory: "bar.cpp")
11 !5 = distinct !DICompileUnit(language: DW_LANG_C99, isOptimized: true, emissionKind: 0, file: !4, enums: !{}, retainedTypes: !{})
12
13 define <{i32, i32}> @f1() {
14 ; CHECK: !dbgx ![[NUMBER:[0-9]+]]
15 %r = insertvalue <{ i32, i32 }> zeroinitializer, i32 4, 1, !dbgx !1
16 ; CHECK: !dbgx ![[NUMBER]]
17 %e = extractvalue <{ i32, i32 }> %r, 0, !dbgx !1
18 ret <{ i32, i32 }> %r
19 }
20
21 ; CHECK: DIFlagProtected
22 !6 = !{i32 1, !"Debug Info Version", i32 3}
0 ; RUN: llc %s -o /dev/null
1 ; Here variable bar is optimized away. Do not trip over while trying to generate debug info.
2
3
4 define i32 @foo() nounwind uwtable readnone ssp {
5 entry:
6 ret i32 42, !dbg !15
7 }
8
9 !llvm.dbg.cu = !{!0}
10 !llvm.module.flags = !{!18}
11
12 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 139632)", isOptimized: true, emissionKind: 0, file: !17, enums: !1, retainedTypes: !1, subprograms: !3, globals: !12)
13 !1 = !{}
14 !3 = !{!5}
15 !5 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !17, scope: !6, type: !7, function: i32 ()* @foo)
16 !6 = !DIFile(filename: "fb.c", directory: "/private/tmp")
17 !7 = !DISubroutineType(types: !8)
18 !8 = !{!9}
19 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
20 !12 = !{!14}
21 !14 = !DIGlobalVariable(name: "bar", line: 2, isLocal: true, isDefinition: true, scope: !5, file: !6, type: !9)
22 !15 = !DILocation(line: 3, column: 3, scope: !16)
23 !16 = distinct !DILexicalBlock(line: 1, column: 11, file: !17, scope: !5)
24 !17 = !DIFile(filename: "fb.c", directory: "/private/tmp")
25 !18 = !{i32 1, !"Debug Info Version", i32 3}
0 ; RUN: llc %s -o /dev/null
1 @0 = internal constant i32 1
2
3 !llvm.dbg.cu = !{!0}
4 !llvm.module.flags = !{!9}
5
6 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 139632)", isOptimized: true, emissionKind: 0, file: !8, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3)
7 !2 = !{}
8 !3 = !{!5}
9 !5 = !DIGlobalVariable(name: "a", line: 2, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: i32* @0)
10 !6 = !DIFile(filename: "g.c", directory: "/private/tmp")
11 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
12 !8 = !DIFile(filename: "g.c", directory: "/private/tmp")
13 !9 = !{i32 1, !"Debug Info Version", i32 3}
0 ; RUN: llc < %s -o /dev/null
1
2 define void @bar(i32 %i) nounwind uwtable ssp {
3 entry:
4 tail call void (...) @foo() nounwind, !dbg !14
5 ret void, !dbg !16
6 }
7
8 declare void @foo(...)
9
10 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
11
12 !llvm.dbg.cu = !{!0}
13 !llvm.module.flags = !{!18}
14
15 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 139632)", isOptimized: true, emissionKind: 0, file: !17, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1)
16 !1 = !{}
17 !3 = !{!5}
18 !5 = distinct !DISubprogram(name: "bar", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !17, scope: !6, type: !7, function: void (i32)* @bar, variables: !9)
19 !6 = !DIFile(filename: "cf.c", directory: "/private/tmp")
20 !7 = !DISubroutineType(types: !8)
21 !8 = !{null}
22 !9 = !{!11}
23 !11 = !DILocalVariable(name: "i", line: 3, arg: 1, scope: !5, file: !17, type: !12)
24 !12 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
25 !13 = !DILocation(line: 3, column: 14, scope: !5)
26 !14 = !DILocation(line: 4, column: 3, scope: !15)
27 !15 = distinct !DILexicalBlock(line: 3, column: 17, file: !17, scope: !5)
28 !16 = !DILocation(line: 5, column: 1, scope: !15)
29 !17 = !DIFile(filename: "cf.c", directory: "/private/tmp")
30 !18 = !{i32 1, !"Debug Info Version", i32 3}
0 ; RUN: llc < %s -o /dev/null
1 ; PR 5942
2 define i8* @foo() nounwind {
3 entry:
4 %0 = load i32, i32* undef, align 4, !dbg !0 ; [#uses=1]
5 %1 = inttoptr i32 %0 to i8*, !dbg !0 ; [#uses=1]
6 ret i8* %1, !dbg !10
7
8 }
9
10 !llvm.dbg.cu = !{!3}
11 !llvm.module.flags = !{!14}
12
13 !0 = !DILocation(line: 571, column: 3, scope: !1)
14 !1 = distinct !DILexicalBlock(line: 1, column: 1, file: !11, scope: !2)
15 !2 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 561, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scope: !3, type: !4)
16 !3 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang 1.1", isOptimized: true, emissionKind: 0, file: !11, enums: !12, retainedTypes: !12, subprograms: !13)
17 !4 = !DISubroutineType(types: !5)
18 !5 = !{!6}
19 !6 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
20 !10 = !DILocation(line: 588, column: 1, scope: !2)
21 !11 = !DIFile(filename: "hashtab.c", directory: "/usr/src/gnu/usr.bin/cc/cc_tools/../../../../contrib/gcclibs/libiberty")
22 !12 = !{}
23 !13 = !{!2}
24 !14 = !{i32 1, !"Debug Info Version", i32 3}
0 ; RUN: llc -O0 < %s -o /dev/null
1 ; llc should not crash on this optimized out debug info.
2 ; PR6588
3 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
4
5 define void @foo() {
6 entry:
7 call void @llvm.dbg.declare(metadata i32* undef, metadata !0, metadata !DIExpression()), !dbg !DILocation(scope: !1)
8 ret void
9 }
10
11 !0 = !DILocalVariable(name: "sy", line: 890, arg: 1, scope: !1, file: !2, type: !7)
12 !1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 892, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !8, scope: !3, type: !4)
13 !2 = !DIFile(filename: "qpainter.h", directory: "QtGui")
14 !3 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang 1.1", isOptimized: true, emissionKind: 0, file: !9, enums: !10, retainedTypes: !10)
15 !4 = !DISubroutineType(types: !6)
16 !5 = !DIFile(filename: "splineeditor.cpp", directory: "src")
17 !6 = !{null}
18 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
19 !8 = !DIFile(filename: "qpainter.h", directory: "QtGui")
20 !9 = !DIFile(filename: "splineeditor.cpp", directory: "src")
21 !10 = !{i32 0}
0 ; RUN: opt < %s -verify -S | FileCheck %s
1
2 ; CHECK: DW_LANG_Mips_Assembler
3
4 define void @Foo(i32 %a, i32 %b) {
5 entry:
6 call void @llvm.dbg.declare(metadata i32* null, metadata !1, metadata !DIExpression()), !dbg !DILocation(scope: !6)
7 ret void
8 }
9 !llvm.dbg.cu = !{!2}
10 !llvm.module.flags = !{!5}
11 !2 = distinct !DICompileUnit(language: DW_LANG_Mips_Assembler, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 1, file: !4, enums: !3, retainedTypes: !3, subprograms: !3, globals: !3, imports: !3)
12 !3 = !{}
13 !0 = !DILocation(line: 662302, column: 26, scope: !1)
14 !1 = !DILocalVariable(name: "foo", scope: !6)
15 !4 = !DIFile(filename: "scratch.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
16 !6 = distinct !DISubprogram()
17
18 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
19 !5 = !{i32 1, !"Debug Info Version", i32 3}
0 ; RUN: %llc_dwarf -O0 < %s | grep AT_decl_file | grep 2
1 ; Here _ZN1S3fooEv is defined in header file identified as AT_decl_file no. 2 in debug info.
2 %struct.S = type <{ i8 }>
3
4 define i32 @_Z3barv() nounwind ssp {
5 entry:
6 %retval = alloca i32 ; [#uses=2]
7 %0 = alloca i32 ; [#uses=2]
8 %s1 = alloca %struct.S ; <%struct.S*> [#uses=1]
9 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
10 call void @llvm.dbg.declare(metadata %struct.S* %s1, metadata !0, metadata !DIExpression()), !dbg !16
11 %1 = call i32 @_ZN1S3fooEv(%struct.S* %s1) nounwind, !dbg !17 ; [#uses=1]
12 store i32 %1, i32* %0, align 4, !dbg !17
13 %2 = load i32, i32* %0, align 4, !dbg !17 ; [#uses=1]
14 store i32 %2, i32* %retval, align 4, !dbg !17
15 br label %return, !dbg !17
16
17 return: ; preds = %entry
18 %retval1 = load i32, i32* %retval, !dbg !17 ; [#uses=1]
19 ret i32 %retval1, !dbg !16
20 }
21
22 define linkonce_odr i32 @_ZN1S3fooEv(%struct.S* %this) nounwind ssp align 2 {
23 entry:
24 %this_addr = alloca %struct.S* ; <%struct.S**> [#uses=1]
25 %retval = alloca i32 ; [#uses=1]
26 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
27 call void @llvm.dbg.declare(metadata %struct.S** %this_addr, metadata !18, metadata !DIExpression()), !dbg !21
28 store %struct.S* %this, %struct.S** %this_addr
29 br label %return, !dbg !21
30
31 return: ; preds = %entry
32 %retval1 = load i32, i32* %retval, !dbg !21 ; [#uses=1]
33 ret i32 %retval1, !dbg !22
34 }
35
36 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
37
38 !llvm.dbg.cu = !{!5}
39 !llvm.module.flags = !{!28}
40
41 !0 = !DILocalVariable(name: "s1", line: 3, scope: !1, file: !4, type: !9)
42 !1 = distinct !DILexicalBlock(line: 3, column: 0, file: !25, scope: !2)
43 !2 = distinct !DILexicalBlock(line: 3, column: 0, file: !25, scope: !3)
44 !3 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 3, file: !25, scope: !4, type: !6, function: i32 ()* @_Z3barv)
45 !4 = !DIFile(filename: "one.cc", directory: "/tmp/")
46 !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !25, enums: !27, retainedTypes: !27, subprograms: !24, imports: null)
47 !6 = !DISubroutineType(types: !7)
48 !7 = !{!8}
49 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
50 !9 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", line: 2, size: 8, align: 8, file: !26, scope: !4, elements: !11)
51 !10 = !DIFile(filename: "one.h", directory: "/tmp/")
52 !11 = !{!12}
53 !12 = distinct !DISubprogram(name: "foo", linkageName: "_ZN1S3fooEv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 3, file: !26, scope: !9, type: !13, function: i32 (%struct.S*)* @_ZN1S3fooEv)
54 !13 = !DISubroutineType(types: !14)
55 !14 = !{!8, !15}
56 !15 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, file: !25, scope: !4, baseType: !9)
57 !16 = !DILocation(line: 3, scope: !1)
58 !17 = !DILocation(line: 3, scope: !3)
59 !18 = !DILocalVariable(name: "this", line: 3, arg: 1, scope: !12, file: !10, type: !19)
60 !19 = !DIDerivedType(tag: DW_TAG_const_type, size: 64, align: 64, flags: DIFlagArtificial, file: !25, scope: !4, baseType: !20)
61 !20 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !25, scope: !4, baseType: !9)
62 !21 = !DILocation(line: 3, scope: !12)
63 !22 = !DILocation(line: 3, scope: !23)
64 !23 = distinct !DILexicalBlock(line: 3, column: 0, file: !26, scope: !12)
65 !24 = !{!3, !12}
66 !25 = !DIFile(filename: "one.cc", directory: "/tmp/")
67 !26 = !DIFile(filename: "one.h", directory: "/tmp/")
68 !27 = !{}
69 !28 = !{i32 1, !"Debug Info Version", i32 3}
0 ; REQUIRES: object-emission
1
2 ; RUN: %llc_dwarf -O0 -filetype=obj -o - < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
3 ; Radar 7833483
4 ; Do not emit a separate out-of-line definition DIE for the function-local 'foo'
5 ; function (member of the function local 'A' type)
6 ; CHECK: DW_TAG_class_type
7 ; CHECK: DW_TAG_class_type
8 ; CHECK-NEXT: DW_AT_name {{.*}} "A"
9 ; Check that the subprogram inside the class definition has low_pc, only
10 ; attached to the definition.
11 ; CHECK: [[FOO_INL:0x........]]: DW_TAG_subprogram
12 ; CHECK-NOT: DW_TAG
13 ; CHECK: DW_AT_low_pc
14 ; CHECK-NOT: DW_TAG
15 ; CHECK: DW_AT_name {{.*}} "foo"
16 ; And just double check that there's no out of line definition that references
17 ; this subprogram.
18 ; CHECK-NOT: DW_AT_specification {{.*}} {[[FOO_INL]]}
19
20 %class.A = type { i8 }
21 %class.B = type { i8 }
22
23 define i32 @main() ssp {
24 entry:
25 %retval = alloca i32, align 4 ; [#uses=3]
26 %b = alloca %class.A, align 1 ; <%class.A*> [#uses=1]
27 store i32 0, i32* %retval
28 call void @llvm.dbg.declare(metadata %class.A* %b, metadata !0, metadata !DIExpression()), !dbg !14
29 %call = call i32 @_ZN1B2fnEv(%class.A* %b), !dbg !15 ; [#uses=1]
30 store i32 %call, i32* %retval, !dbg !15
31 %0 = load i32, i32* %retval, !dbg !16 ; [#uses=1]
32 ret i32 %0, !dbg !16
33 }
34
35 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
36
37 define linkonce_odr i32 @_ZN1B2fnEv(%class.A* %this) ssp align 2 {
38 entry:
39 %retval = alloca i32, align 4 ; [#uses=2]
40 %this.addr = alloca %class.A*, align 8 ; <%class.A**> [#uses=2]
41 %a = alloca %class.A, align 1 ; <%class.A*> [#uses=1]
42 %i = alloca i32, align 4 ; [#uses=2]
43 store %class.A* %this, %class.A** %this.addr
44 call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !17, metadata !DIExpression()), !dbg !18
45 %this1 = load %class.A*, %class.A** %this.addr ; <%class.A*> [#uses=0]
46 call void @llvm.dbg.declare(metadata %class.A* %a, metadata !19, metadata !DIExpression()), !dbg !27
47 call void @llvm.dbg.declare(metadata i32* %i, metadata !28, metadata !DIExpression()), !dbg !29
48 %call = call i32 @_ZZN1B2fnEvEN1A3fooEv(%class.A* %a), !dbg !30 ; [#uses=1]
49 store i32 %call, i32* %i, !dbg !30
50 %tmp = load i32, i32* %i, !dbg !31 ; [#uses=1]
51 store i32 %tmp, i32* %retval, !dbg !31
52 %0 = load i32, i32* %retval, !dbg !32 ; [#uses=1]
53 ret i32 %0, !dbg !32
54 }
55
56 define internal i32 @_ZZN1B2fnEvEN1A3fooEv(%class.A* %this) ssp align 2 {
57 entry:
58 %retval = alloca i32, align 4 ; [#uses=2]
59 %this.addr = alloca %class.A*, align 8 ; <%class.A**> [#uses=2]
60 store %class.A* %this, %class.A** %this.addr
61 call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !33, metadata !DIExpression()), !dbg !34
62 %this1 = load %class.A*, %class.A** %this.addr ; <%class.A*> [#uses=0]
63 store i32 42, i32* %retval, !dbg !35
64 %0 = load i32, i32* %retval, !dbg !35 ; [#uses=1]
65 ret i32 %0, !dbg !35
66 }
67
68 !llvm.dbg.cu = !{!4}
69 !llvm.module.flags = !{!40}
70 !37 = !{!2, !10, !23}
71
72 !0 = !DILocalVariable(name: "b", line: 16, scope: !1, file: !3, type: !8)
73 !1 = distinct !DILexicalBlock(line: 15, column: 12, file: !38, scope: !2)
74 !2 = distinct !DISubprogram(name: "main", linkageName: "main", line: 15, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 15, file: !38, scope: !3, type: !5, function: i32 ()* @main)
75 !3 = !DIFile(filename: "one.cc", directory: "/tmp")
76 !4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang 1.5", isOptimized: false, emissionKind: 0, file: !38, enums: !39, retainedTypes: !39, subprograms: !37, imports: null)
77 !5 = !DISubroutineType(types: !6)
78 !6 = !{!7}
79 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
80 !8 = !DICompositeType(tag: DW_TAG_class_type, name: "B", line: 2, size: 8, align: 8, file: !38, scope: !3, elements: !9)
81 !9 = !{!10}
82 !10 = distinct !DISubprogram(name: "fn", linkageName: "_ZN1B2fnEv", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 4, file: !38, scope: !8, type: !11, function: i32 (%class.A*)* @_ZN1B2fnEv)
83 !11 = !DISubroutineType(types: !12)
84 !12 = !{!7, !13}
85 !13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, file: !38, scope: !3, baseType: !8)
86 !14 = !DILocation(line: 16, column: 5, scope: !1)
87 !15 = !DILocation(line: 17, column: 3, scope: !1)
88 !16 = !DILocation(line: 18, column: 1, scope: !2)
89 !17 = !DILocalVariable(name: "this", line: 4, arg: 1, scope: !10, file: !3, type: !13)
90 !18 = !DILocation(line: 4, column: 7, scope: !10)
91 !19 = !DILocalVariable(name: "a", line: 9, scope: !20, file: !3, type: !21)
92 !20 = distinct !DILexicalBlock(line: 4, column: 12, file: !38, scope: !10)
93 !21 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 5, size: 8, align: 8, file: !38, scope: !10, elements: !22)
94 !22 = !{!23}
95 !23 = distinct !DISubprogram(name: "foo", linkageName: "_ZZN1B2fnEvEN1A3fooEv", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 7, file: !38, scope: !21, type: !24, function: i32 (%class.A*)* @_ZZN1B2fnEvEN1A3fooEv)
96 !24 = !DISubroutineType(types: !25)
97 !25 = !{!7, !26}
98 !26 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, file: !38, scope: !3, baseType: !21)
99 !27 = !DILocation(line: 9, column: 7, scope: !20)
100 !28 = !DILocalVariable(name: "i", line: 10, scope: !20, file: !3, type: !7)
101 !29 = !DILocation(line: 10, column: 9, scope: !20)
102 !30 = !DILocation(line: 10, column: 5, scope: !20)
103 !31 = !DILocation(line: 11, column: 5, scope: !20)
104 !32 = !DILocation(line: 12, column: 3, scope: !10)
105 !33 = !DILocalVariable(name: "this", line: 7, arg: 1, scope: !23, file: !3, type: !26)
106 !34 = !DILocation(line: 7, column: 11, scope: !23)
107 !35 = !DILocation(line: 7, column: 19, scope: !36)
108 !36 = distinct !DILexicalBlock(line: 7, column: 17, file: !38, scope: !23)
109 !38 = !DIFile(filename: "one.cc", directory: "/tmp")
110 !39 = !{}
111 !40 = !{i32 1, !"Debug Info Version", i32 3}
0 ; RUN: %llc_dwarf -asm-verbose -O1 -o %t < %s
1 ; RUN: grep DW_AT_APPLE_omit_frame_ptr %t
2 ; RUN: %llc_dwarf -disable-fp-elim -asm-verbose -O1 -o %t < %s
3 ; RUN: grep -v DW_AT_APPLE_omit_frame_ptr %t
4
5
6 define i32 @foo() nounwind ssp {
7 entry:
8 %retval = alloca i32 ; [#uses=2]
9 %0 = alloca i32 ; [#uses=2]
10 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
11 store i32 42, i32* %0, align 4, !dbg !0
12 %1 = load i32, i32* %0, align 4, !dbg !0 ; [#uses=1]
13 store i32 %1, i32* %retval, align 4, !dbg !0
14 br label %return, !dbg !0
15
16 return: ; preds = %entry
17 %retval1 = load i32, i32* %retval, !dbg !0 ; [#uses=1]
18 ret i32 %retval1, !dbg !7
19 }
20
21 !llvm.dbg.cu = !{!3}
22 !llvm.module.flags = !{!12}
23 !9 = !{!1}
24
25 !0 = !DILocation(line: 2, scope: !1)
26 !1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !10, scope: null, type: !4, function: i32 ()* @foo)
27 !2 = !DIFile(filename: "a.c", directory: "/tmp")
28 !3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !10, enums: !11, retainedTypes: !11, subprograms: !9, imports: null)
29 !4 = !DISubroutineType(types: !5)
30 !5 = !{!6}
31 !6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
32 !7 = !DILocation(line: 2, scope: !8)
33 !8 = distinct !DILexicalBlock(line: 2, column: 0, file: !10, scope: !1)
34 !10 = !DIFile(filename: "a.c", directory: "/tmp")
35 !11 = !{}
36 !12 = !{i32 1, !"Debug Info Version", i32 3}
0 ; RUN: llc -o /dev/null < %s
1 ; Radar 7937664
2 %struct.AppleEvent = type opaque
3
4 define void @DisposeDMNotificationUPP(void (%struct.AppleEvent*)* %userUPP) "no-frame-pointer-elim-non-leaf" nounwind ssp {
5 entry:
6 %userUPP_addr = alloca void (%struct.AppleEvent*)* ; [#uses=1]
7 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
8 call void @llvm.dbg.declare(metadata void (%struct.AppleEvent*)** %userUPP_addr, metadata !0, metadata !DIExpression()), !dbg !13
9 store void (%struct.AppleEvent*)* %userUPP, void (%struct.AppleEvent*)** %userUPP_addr
10 br label %return, !dbg !14
11
12 return: ; preds = %entry
13 ret void, !dbg !14
14 }
15
16 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
17
18 !llvm.dbg.cu = !{!3}
19 !llvm.module.flags = !{!19}
20 !0 = !DILocalVariable(name: "userUPP", line: 7, arg: 1, scope: !1, file: !2, type: !6)
21 !1 = distinct !DISubprogram(name: "DisposeDMNotificationUPP", linkageName: "DisposeDMNotificationUPP", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !16, scope: null, type: !4)
22 !2 = !DIFile(filename: "t.c", directory: "/Users/echeng/LLVM/radars/r7937664/")
23 !3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build 9999)", isOptimized: true, emissionKind: 0, file: !16, enums: !17, retainedTypes: !17, subprograms: !18)
24 !4 = !DISubroutineType(types: !5)
25 !5 = !{null, !6}
26 !6 = !DIDerivedType(tag: DW_TAG_typedef, name: "DMNotificationUPP", line: 6, file: !16, scope: !2, baseType: !7)
27 !7 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !16, scope: !2, baseType: !8)
28 !8 = !DISubroutineType(types: !9)
29 !9 = !{null, !10}
30 !10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !16, scope: !2, baseType: !11)
31 !11 = !DIDerivedType(tag: DW_TAG_typedef, name: "AppleEvent", line: 4, file: !16, scope: !2, baseType: !12)
32 !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "AEDesc", line: 1, flags: DIFlagFwdDecl, file: !16, scope: !2)
33 !13 = !DILocation(line: 7, scope: !1)
34 !14 = !DILocation(line: 8, scope: !15)
35 !15 = distinct !DILexicalBlock(line: 7, column: 0, file: !16, scope: !1)
36 !16 = !DIFile(filename: "t.c", directory: "/Users/echeng/LLVM/radars/r7937664/")
37 !17 = !{}
38 !18 = !{!1}
39 !19 = !{i32 1, !"Debug Info Version", i32 3}
0
1 ;RUN: llc < %s -o /dev/null
2 ;Radar 7937109
3
4 %struct.anon = type { i64, i32, i32, i32, [1 x i32] }
5 %struct.gpm_t = type { i32, i8*, [16 x i8], i32, i64, i64, i64, i64, i64, i64, i32, i16, i16, [8 x %struct.gpmr_t] }
6 %struct.gpmr_t = type { [48 x i8], [48 x i8], [16 x i8], i64, i64, i64, i64, i16 }
7 %struct.gpt_t = type { [8 x i8], i32, i32, i32, i32, i64, i64, i64, i64, [16 x i8], %struct.anon }
8
9 @llvm.used = appending global [1 x i8*] [i8* bitcast (void (%struct.gpm_t*, %struct.gpt_t*)* @gpt2gpm to i8*)], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0]
10
11 define fastcc void @gpt2gpm(%struct.gpm_t* %gpm, %struct.gpt_t* %gpt) nounwind optsize ssp {
12 entry:
13 %data_addr.i18 = alloca i64, align 8 ; [#uses=1]
14 %data_addr.i17 = alloca i64, align 8 ; [#uses=2]
15 %data_addr.i16 = alloca i64, align 8 ; [#uses=0]
16 %data_addr.i15 = alloca i32, align 4 ; [#uses=0]
17 %data_addr.i = alloca i64, align 8 ; [#uses=0]
18 %0 = getelementptr inbounds %struct.gpm_t, %struct.gpm_t* %gpm, i32 0, i32 2, i32 0 ; [#uses=1]
19 %1 = getelementptr inbounds %struct.gpt_t, %struct.gpt_t* %gpt, i32 0, i32 9, i32 0 ; [#uses=1]
20 call void @uuid_LtoB(i8* %0, i8* %1) nounwind, !dbg !0
21 %a9 = load volatile i64, i64* %data_addr.i18, align 8 ; [#uses=1]
22 %a10 = call i64 @llvm.bswap.i64(i64 %a9) nounwind ; [#uses=1]
23 %a11 = getelementptr inbounds %struct.gpt_t, %struct.gpt_t* %gpt, i32 0, i32 8, !dbg !7 ; [#uses=1]
24 %a12 = load i64, i64* %a11, align 4, !dbg !7 ; [#uses=1]
25 call void @llvm.dbg.declare(metadata i64* %data_addr.i17, metadata !8, metadata !DIExpression()) nounwind, !dbg !14
26 store i64 %a12, i64* %data_addr.i17, align 8
27 call void @llvm.dbg.value(metadata !6, i64 0, metadata !15, metadata !DIExpression()) nounwind, !dbg !DILocation(scope: !16)
28 call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !19, metadata !DIExpression()) nounwind, !dbg !DILocation(scope: !16)
29 call void @llvm.dbg.declare(metadata !6, metadata !23, metadata !DIExpression()) nounwind, !dbg !DILocation(scope: !24)
30 call void @llvm.dbg.value(metadata i64* %data_addr.i17, i64 0, metadata !34, metadata !DIExpression()) nounwind, !dbg !DILocation(scope: !24)
31 %a13 = load volatile i64, i64* %data_addr.i17, align 8 ; [#uses=1]
32 %a14 = call i64 @llvm.bswap.i64(i64 %a13) nounwind ; [#uses=2]
33 %a15 = add i64 %a10, %a14, !dbg !7 ; [#uses=1]
34 %a16 = sub i64 %a15, %a14 ; [#uses=1]
35 %a17 = getelementptr inbounds %struct.gpm_t, %struct.gpm_t* %gpm, i32 0, i32 5, !dbg !7 ; [#uses=1]
36 store i64 %a16, i64* %a17, align 4, !dbg !7
37 ret void, !dbg !7
38 }
39
40 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
41
42 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
43
44 declare i32 @llvm.bswap.i32(i32) nounwind readnone
45
46 declare i64 @llvm.bswap.i64(i64) nounwind readnone
47
48 declare void @uuid_LtoB(i8*, i8*)
49
50 !llvm.dbg.cu = !{!4}
51 !llvm.module.flags = !{!41}
52 !0 = !DILocation(line: 808, scope: !1)
53 !1 = distinct !DILexicalBlock(line: 807, column: 0, file: !39, scope: !2)
54 !2 = distinct !DISubprogram(name: "gpt2gpm", linkageName: "gpt2gpm", line: 807, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !39, scope: null, type: !5)
55 !3 = !DIFile(filename: "G.c", directory: "/tmp")
56 !4 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "llvm-gcc", isOptimized: true, emissionKind: 0, file: !39, enums: !18, retainedTypes: !18, subprograms: !40)
57 !5 = !DISubroutineType(types: !6)
58 !6 = !{null}
59 !7 = !DILocation(line: 810, scope: !1)
60 !8 = !DILocalVariable(name: "data", line: 201, arg: 1, scope: !9, file: !10, type: !11)
61 !9 = distinct !DISubprogram(name: "_OSSwapInt64", linkageName: "_OSSwapInt64", line: 202, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !10, scope: null, type: !5)
62 !10 = !DIFile(filename: "OSByteOrder.h", directory: "/usr/include/libkern/ppc")
63 !11 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint64_t", line: 59, file: !36, scope: !3, baseType: !13)
64 !12 = !DIFile(filename: "stdint.h", directory: "/usr/4.2.1/include")
65 !13 = !DIBasicType(tag: DW_TAG_base_type, name: "long long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned)
66 !14 = !DILocation(line: 202, scope: !9, inlinedAt: !7)
67 !15 = !DILocalVariable(name: "base", line: 92, arg: 2, scope: !16, file: !10, type: !17)
68 !16 = distinct !DISubprogram(name: "OSReadSwapInt64", linkageName: "OSReadSwapInt64", line: 95, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !38, scope: null, type: !5)
69 !17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !39, scope: !3, baseType: null)
70 !18 = !{}
71 !19 = !DILocalVariable(name: "byteOffset", line: 94, arg: 3, scope: !16, file: !10, type: !20)
72 !20 = !DIDerivedType(tag: DW_TAG_typedef, name: "uintptr_t", line: 114, file: !37, scope: !3, baseType: !22)
73 !21 = !DIFile(filename: "types.h", directory: "/usr/include/ppc")
74 !22 = !DIBasicType(tag: DW_TAG_base_type, name: "long unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)
75 !23 = !DILocalVariable(name: "u", line: 100, scope: !24, file: !10, type: !25)
76 !24 = distinct !DILexicalBlock(line: 95, column: 0, file: !38, scope: !16)
77 !25 = !DICompositeType(tag: DW_TAG_union_type, line: 97, size: 64, align: 64, file: !38, scope: !16, elements: !26)
78 !26 = !{!27, !28}
79 !27 = !DIDerivedType(tag: DW_TAG_member, name: "u64", line: 98, size: 64, align: 64, file: !38, scope: !25, baseType: !11)
80 !28 = !DIDerivedType(tag: DW_TAG_member, name: "u32", line: 99, size: 64, align: 32, file: !38, scope: !25, baseType: !29)
81 !29 = !DICompositeType(tag: DW_TAG_array_type, size: 64, align: 32, file: !39, scope: !3, baseType: !30, elements: !32)
82 !30 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint32_t", line: 55, file: !36, scope: !3, baseType: !31)
83 !31 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)
84 !32 = !{!33}
85 !33 = !DISubrange(count: 2)
86 !34 = !DILocalVariable(name: "addr", line: 96, scope: !24, file: !10, type: !35)
87 !35 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !39, scope: !3, baseType: !11)
88 !36 = !DIFile(filename: "stdint.h", directory: "/usr/4.2.1/include")
89 !37 = !DIFile(filename: "types.h", directory: "/usr/include/ppc")
90 !38 = !DIFile(filename: "OSByteOrder.h", directory: "/usr/include/libkern/ppc")
91 !39 = !DIFile(filename: "G.c", directory: "/tmp")
92 !40 = !{!2, !9, !16}
93 !41 = !{i32 1, !"Debug Info Version", i32 3}
0 ; REQUIRES: object-emission
1
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
3
4 ; Check that two compile units are generated
5
6 ; CHECK: Compile Unit:
7 ; CHECK: Compile Unit:
8
9 define i32 @foo() nounwind readnone ssp {
10 return:
11 ret i32 42, !dbg !0
12 }
13
14 define i32 @bar() nounwind readnone ssp {
15 return:
16 ret i32 21, !dbg !8
17 }
18
19 !llvm.dbg.cu = !{!4, !12}
20 !llvm.module.flags = !{!21}
21 !16 = !{!2}
22 !17 = !{!10}
23
24 !0 = !DILocation(line: 3, scope: !1)
25 !1 = distinct !DILexicalBlock(line: 2, column: 0, file: !18, scope: !2)
26 !2 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !18, scope: !3, type: !5, function: i32 ()* @foo)
27 !3 = !DIFile(filename: "a.c", directory: "/tmp/")
28 !4 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !18, enums: !19, retainedTypes: !19, subprograms: !16)
29 !5 = !DISubroutineType(types: !6)
30 !6 = !{!7}
31 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
32 !8 = !DILocation(line: 3, scope: !9)
33 !9 = distinct !DILexicalBlock(line: 2, column: 0, file: !20, scope: !10)
34 !10 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !20, scope: !11, type: !13, function: i32 ()* @bar)
35 !11 = !DIFile(filename: "b.c", directory: "/tmp/")
36 !12 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !20, enums: !19, retainedTypes: !19, subprograms: !17)
37 !13 = !DISubroutineType(types: !14)
38 !14 = !{!15}
39 !15 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
40 !18 = !DIFile(filename: "a.c", directory: "/tmp/")
41 !19 = !{}
42 !20 = !DIFile(filename: "b.c", directory: "/tmp/")
43 !21 = !{i32 1, !"Debug Info Version", i32 3}
0 ; RUN: %llc_dwarf -O2 %s -o - | FileCheck %s
1 ; Check struct X for dead variable xyz from inlined function foo.
2
3 ; CHECK: section_info
4 ; CHECK: DW_TAG_structure_type
5 ; CHECK-NEXT: DW_AT_name
6
7
8 @i = common global i32 0 ; [#uses=2]
9
10 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
11
12 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
13
14 define i32 @bar() nounwind ssp {
15 entry:
16 %0 = load i32, i32* @i, align 4, !dbg !17 ; [#uses=2]
17 tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !59, metadata !DIExpression()), !dbg !19
18 tail call void @llvm.dbg.declare(metadata !29, metadata !60, metadata !DIExpression()), !dbg !21
19 %1 = mul nsw i32 %0, %0, !dbg !22 ; [#uses=2]
20 store i32 %1, i32* @i, align 4, !dbg !17
21 ret i32 %1, !dbg !23
22 }
23
24 !llvm.dbg.cu = !{!2}
25 !llvm.module.flags = !{!28}
26
27 !0 = distinct !DISubprogram(name: "foo", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 9, file: !27, scope: !1, type: !3, variables: !24)
28 !1 = !DIFile(filename: "bar.c", directory: "/tmp/")
29 !2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !20, subprograms: !25, globals: !26, imports: !20)
30 !3 = !DISubroutineType(types: !4)
31 !4 = !{!5, !5}
32 !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
33 !6 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !27, scope: !1, type: !7, function: i32 ()* @bar)
34 !7 = !DISubroutineType(types: !8)
35 !8 = !{!5}
36 !9 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5)
37 !10 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12)
38
39 !59 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5)
40 !60 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12)
41
42 !11 = distinct !DILexicalBlock(line: 9, column: 0, file: !1, scope: !0)
43 !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", line: 10, size: 64, align: 32, file: !27, scope: !0, elements: !13)
44 !13 = !{!14, !15}
45 !14 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 10, size: 32, align: 32, file: !27, scope: !12, baseType: !5)
46 !15 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 10, size: 32, align: 32, offset: 32, file: !27, scope: !12, baseType: !5)
47 !16 = !DIGlobalVariable(name: "i", line: 5, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !5, variable: i32* @i)
48 !17 = !DILocation(line: 15, scope: !18)
49 !18 = distinct !DILexicalBlock(line: 14, column: 0, file: !1, scope: !6)
50 !19 = !DILocation(line: 9, scope: !0, inlinedAt: !17)
51 !20 = !{}
52 !21 = !DILocation(line: 9, scope: !11, inlinedAt: !17)
53 !22 = !DILocation(line: 11, scope: !11, inlinedAt: !17)
54 !23 = !DILocation(line: 16, scope: !18)
55 !24 = !{!9, !10}
56 !25 = !{!0, !6}
57 !26 = !{!16}
58 !27 = !DIFile(filename: "bar.c", directory: "/tmp/")
59 !28 = !{i32 1, !"Debug Info Version", i32 3}
60 !29 = !{null}
0 ; RUN: llc -o /dev/null < %s
1 ; PR7662
2 ; Do not add variables to !11 because it is a declaration entry.
3
4 define i32 @bar() nounwind readnone ssp {
5 entry:
6 ret i32 42, !dbg !9
7 }
8
9 !llvm.dbg.cu = !{!2}
10 !llvm.module.flags = !{!15}
11 !llvm.dbg.sp = !{!0, !6, !11}
12 !llvm.dbg.lv.foo = !{!7}
13
14 !0 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !12, scope: !1, type: !3, function: i32 ()* @bar)
15 !1 = !DIFile(filename: "one.c", directory: "/private/tmp")
16 !2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang 2.8", isOptimized: true, emissionKind: 0, file: !12, enums: !14, retainedTypes: !14, subprograms: !13)
17 !3 = !DISubroutineType(types: !4)
18 !4 = !{!5}
19 !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
20 !6 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 7, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !12, scope: !1, type: !3)
21 !7 = !DILocalVariable(name: "one", line: 8, scope: !8, file: !1, type: !5)
22 !8 = distinct !DILexicalBlock(line: 7, column: 18, file: !12, scope: !6)
23 !9 = !DILocation(line: 4, column: 3, scope: !10)
24 !10 = distinct !DILexicalBlock(line: 3, column: 11, file: !12, scope: !0)
25 !11 = !DISubprogram(name: "foo", linkageName: "foo", line: 7, isLocal: true, isDefinition: false, virtualIndex: 6, isOptimized: true, file: !12, scope: !1, type: !3)
26 !12 = !DIFile(filename: "one.c", directory: "/private/tmp")
27 !13 = !{!0}
28 !14 = !{}
29 !15 = !{i32 1, !"Debug Info Version", i32 3}
0 ; RUN: llc -O0 %s -o /dev/null
1
2 define void @CGRectStandardize(i32* sret %agg.result, i32* byval %rect) nounwind ssp {
3 entry:
4 call void @llvm.dbg.declare(metadata i32* %rect, metadata !23, metadata !DIExpression()), !dbg !24
5 ret void
6 }
7
8 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
9
10 declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
11
12
13 !llvm.dbg.cu = !{!2}
14 !llvm.module.flags = !{!27}
15 !0 = distinct !DISubprogram(name: "CGRectStandardize", linkageName: "CGRectStandardize", line: 54, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !1, scope: null, function: void (i32*, i32*)* @CGRectStandardize)
16 !1 = !DIFile(filename: "GSFusedSilica.m", directory: "/Volumes/Data/Users/sabre/Desktop")
17 !2 = distinct !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 2.9 (trunk 115292)", isOptimized: true, runtimeVersion: 1, emissionKind: 0, file: !25, enums: !26, retainedTypes: !26, subprograms: !{!0})
18 !5 = !DIDerivedType(tag: DW_TAG_typedef, name: "CGRect", line: 49, file: !25, baseType: null)
19 !23 = !DILocalVariable(name: "rect", line: 53, arg: 2, scope: !0, file: !1, type: !5)
20 !24 = !DILocation(line: 53, column: 33, scope: !0)
21 !25 = !DIFile(filename: "GSFusedSilica.m", directory: "/Volumes/Data/Users/sabre/Desktop")
22 !26 = !{}
23 !27 = !{i32 1, !"Debug Info Version", i32 3}
0 ; REQUIRES: object-emission
1
2 ; For some reason, the output when targetting sparc is not quite as expected.
3 ; XFAIL: sparc
4
5 ; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=Enable < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
6
7 ; IR generated from clang -O0 with:
8 ; struct C {
9 ; ~C();
10 ; };
11 ; extern bool b;
12 ; void fun4() { b && (C(), 1); }
13 ; __attribute__((always_inline)) C::~C() { }
14
15 ; CHECK: DW_TAG_structure_type
16 ; CHECK-NOT: DW_TAG
17 ; CHECK: DW_AT_name {{.*}} "C"
18 ; CHECK-NOT: {{DW_TAG|NULL}}
19 ; CHECK: DW_TAG_subprogram
20 ; CHECK-NOT: DW_TAG
21 ; CHECK: DW_AT_name {{.*}} "~C"
22
23 ; CHECK: DW_TAG_subprogram
24 ; CHECK-NOT: DW_TAG
25 ; CHECK: DW_AT_linkage_name {{.*}} "_ZN1CD1Ev"
26 ; CHECK-NOT: {{DW_TAG|NULL}}
27 ; CHECK: DW_TAG_formal_parameter
28 ; CHECK-NOT: DW_TAG
29 ; CHECK: DW_AT_name {{.*}} "this"
30
31 ; CHECK: DW_TAG_subprogram
32 ; CHECK-NOT: DW_TAG
33 ; CHECK: DW_AT_name {{.*}} "fun4"
34 ; CHECK-NOT: {{DW_TAG|NULL}}
35 ; CHECK: DW_TAG_inlined_subroutine
36 ; CHECK-NOT: DW_TAG
37 ; CHECK: DW_AT_abstract_origin {{.*}} "_ZN1CD1Ev"
38 ; CHECK-NOT: {{DW_TAG|NULL}}
39 ; CHECK: DW_TAG_formal_parameter
40 ; CHECK-NOT: DW_TAG
41 ; CHECK: DW_AT_abstract_origin {{.*}} "this"
42
43 ; FIXME: D2 is actually inlined into D1 but doesn't show up here, possibly due
44 ; to there being no work in D2 (calling another member function from the dtor
45 ; causes D2 to show up, calling a free function doesn't).
46
47 ; CHECK-NOT: DW_TAG
48 ; CHECK: NULL
49 ; CHECK-NOT: DW_TAG
50 ; CHECK: NULL
51
52 %struct.C = type { i8 }
53
54 @b = external global i8
55
56 ; Function Attrs: nounwind
57 define void @_Z4fun4v() #0 {
58 entry:
59 %this.addr.i.i = alloca %struct.C*, align 8, !dbg !21
60 %this.addr.i = alloca %struct.C*, align 8, !dbg !22
61 %agg.tmp.ensured = alloca %struct.C, align 1
62 %cleanup.cond = alloca i1
63 %0 = load i8, i8* @b, align 1, !dbg !24
64 %tobool = trunc i8 %0 to i1, !dbg !24
65 store i1 false, i1* %cleanup.cond
66 br i1 %tobool, label %land.rhs, label %land.end, !dbg !24
67
68 land.rhs: ; preds = %entry
69 store i1 true, i1* %cleanup.cond, !dbg !25
70 br label %land.end
71
72 land.end: ; preds = %land.rhs, %entry
73 %1 = phi i1 [ false, %entry ], [ true, %land.rhs ]
74 %cleanup.is_active = load i1, i1* %cleanup.cond, !dbg !27
75 br i1 %cleanup.is_active, label %cleanup.action, label %cleanup.done, !dbg !27
76
77 cleanup.action: ; preds = %land.end
78 store %struct.C* %agg.tmp.ensured, %struct.C** %this.addr.i, align 8, !dbg !22
79 call void @llvm.dbg.declare(metadata %struct.C** %this.addr.i, metadata !129, metadata !DIExpression()), !dbg !31
80 %this1.i = load %struct.C*, %struct.C** %this.addr.i, !dbg !22
81 store %struct.C* %this1.i, %struct.C** %this.addr.i.i, align 8, !dbg !21
82 call void @llvm.dbg.declare(metadata %struct.C** %this.addr.i.i, metadata !132, metadata !DIExpression()), !dbg !33
83 %this1.i.i = load %struct.C*, %struct.C** %this.addr.i.i, !dbg !21
84 br label %cleanup.done, !dbg !22
85
86 cleanup.done: ; preds = %cleanup.action, %land.end
87 ret void, !dbg !34
88 }
89
90 ; Function Attrs: alwaysinline nounwind
91 define void @_ZN1CD1Ev(%struct.C* %this) unnamed_addr #1 align 2 {
92 entry:
93 %this.addr.i = alloca %struct.C*, align 8, !dbg !37
94 %this.addr = alloca %struct.C*, align 8
95 store %struct.C* %this, %struct.C** %this.addr, align 8
96 call void @llvm.dbg.declare(metadata %struct.C** %this.addr, metadata !29, metadata !DIExpression()), !dbg !38
97 %this1 = load %struct.C*, %struct.C** %this.addr
98 store %struct.C* %this1, %struct.C** %this.addr.i, align 8, !dbg !37
99 call void @llvm.dbg.declare(metadata %struct.C** %this.addr.i, metadata !232, metadata !DIExpression()), !dbg !39
100 %this1.i = load %struct.C*, %struct.C** %this.addr.i, !dbg !37
101 ret void, !dbg !37
102 }
103
104 ; Function Attrs: alwaysinline nounwind
105 define void @_ZN1CD2Ev(%struct.C* %this) unnamed_addr #1 align 2 {
106 entry:
107 %this.addr = alloca %struct.C*, align 8
108 store %struct.C* %this, %struct.C** %this.addr, align 8
109 call void @llvm.dbg.declare(metadata %struct.C** %this.addr, metadata !32, metadata !DIExpression()), !dbg !40
110 %this1 = load %struct.C*, %struct.C** %this.addr
111 ret void, !dbg !41
112 }
113
114 ; Function Attrs: nounwind readnone
115 declare void @llvm.dbg.declare(metadata, metadata, metadata) #2
116
117 attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
118 attributes #1 = { alwaysinline nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
119 attributes #2 = { nounwind readnone }
120
121 !llvm.dbg.cu = !{!0}
122 !llvm.module.flags = !{!18, !19}
123 !llvm.ident = !{!20}
124
125 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !11, globals: !2, imports: !2)
126 !1 = !DIFile(filename: "", directory: "/tmp/dbginfo")
127 !2 = !{}
128 !3 = !{!4}
129 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "C", line: 1, size: 8, align: 8, file: !5, elements: !6, identifier: "_ZTS1C")
130 !5 = !DIFile(filename: "PR20038.cpp", directory: "/tmp/dbginfo")
131 !6 = !{!7}
132 !7 = !DISubprogram(name: "~C", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !5, scope: !"_ZTS1C", type: !8)
133 !8 = !DISubroutineType(types: !9)
134 !9 = !{null, !10}
135 !10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1C")
136 !11 = !{!12, !16, !17}
137 !12 = distinct !DISubprogram(name: "fun4", linkageName: "_Z4fun4v", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !5, scope: !13, type: !14, function: void ()* @_Z4fun4v, variables: !2)
138 !13 = !DIFile(filename: "PR20038.cpp", directory: "/tmp/dbginfo")
139 !14 = !DISubroutineType(types: !15)
140 !15 = !{null}
141 !16 = distinct !DISubprogram(name: "~C", linkageName: "_ZN1CD2Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !5, scope: !"_ZTS1C", type: !8, function: void (%struct.C*)* @_ZN1CD2Ev, declaration: !7, variables: !2)
142 !17 = distinct !DISubprogram(name: "~C", linkageName: "_ZN1CD1Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !5, scope: !"_ZTS1C", type: !8, function: void (%struct.C*)* @_ZN1CD1Ev, declaration: !7, variables: !2)
143 !18 = !{i32 2, !"Dwarf Version", i32 4}
144 !19 = !{i32 2, !"Debug Info Version", i32 3}
145 !20 = !{!"clang version 3.5.0 "}
146 !21 = !DILocation(line: 6, scope: !17, inlinedAt: !22)
147 !22 = !DILocation(line: 5, scope: !23)
148 !23 = distinct !DILexicalBlock(line: 5, column: 0, file: !5, scope: !12)
149 !24 = !DILocation(line: 5, scope: !12)
150 !25 = !DILocation(line: 5, scope: !26)
151 !26 = distinct !DILexicalBlock(line: 5, column: 0, file: !5, scope: !12)
152 !27 = !DILocation(line: 5, scope: !28)
153 !28 = distinct !DILexicalBlock(line: 5, column: 0, file: !5, scope: !12)
154 !29 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !17, type: !30)
155 !30 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1C")
156 !31 = !DILocation(line: 0, scope: !17, inlinedAt: !22)
157 !32 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !16, type: !30)
158 !33 = !DILocation(line: 0, scope: !16, inlinedAt: !21)
159
160 !129 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !17, type: !30)
161 !132 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !16, type: !30)
162 !232 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !16, type: !30)
163
164 !34 = !DILocation(line: 5, scope: !35)
165 !35 = distinct !DILexicalBlock(line: 5, column: 0, file: !5, scope: !36)
166 !36 = distinct !DILexicalBlock(line: 5, column: 0, file: !5, scope: !12)
167 !37 = !DILocation(line: 6, scope: !17)
168 !38 = !DILocation(line: 0, scope: !17)
169 !39 = !DILocation(line: 0, scope: !16, inlinedAt: !37)
170 !40 = !DILocation(line: 0, scope: !16)
171 !41 = !DILocation(line: 6, scope: !16)
0 ; REQUIRES: object-emission
1 ; RUN: %llc_dwarf -dwarf-accel-tables=Enable -filetype=obj -o - < %s | llvm-dwarfdump -debug-dump=apple_names - | FileCheck %s
2
3 ; Generated from the following C code using
4 ; clang -S -emit-llvm hash-collision.c
5 ;
6 ; The names of the variables have been chosen so that they produce hash collisions.
7 ; There are 12 names here that are hashed to only 6 hashes (each pair of lines
8 ; hashes to the same value, see the CHECK lines below).
9 ;
10 ; int ForceTopDown;
11 ; int _ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_;
12 ; int _ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE;
13 ; int _ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv;
14 ; int _ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE;
15 ; int _ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE;
16 ; int k1;
17 ; int is;
18 ; int setStmt;
19 ; int _ZN4llvm5TwineC1Ei;
20 ; int _ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE;
21 ; int _ZN4llvm22MachineModuleInfoMachOD2Ev;
22
23 ; Check that we have the right amount of hashes.
24 ; CHECK: Bucket count = 6
25 ; CHECK: Hashes count = 6
26
27 ; Check that all the names are present in the output
28 ; CHECK: Hash = 0x00597841
29 ; CHECK: Name: {{[0-9a-f]*}} "is"
30 ; CHECK: Name: {{[0-9a-f]*}} "k1"
31
32 ; CHECK: Hash = 0xa4b42a1e
33 ; CHECK: Name: {{[0-9a-f]*}} "_ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE"
34 ; CHECK: Name: {{[0-9a-f]*}} "_ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv"
35
36 ; CHECK: Hash = 0xeee7c0b2
37 ; CHECK: Name: {{[0-9a-f]*}} "_ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE"
38 ; CHECK: Name: {{[0-9a-f]*}} "_ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE"
39
40 ; CHECK: Hash = 0xea48ac5f
41 ; CHECK: Name: {{[0-9a-f]*}} "ForceTopDown"
42 ; CHECK: Name: {{[0-9a-f]*}} "_ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_"
43
44 ; CHECK: Hash = 0x6b22f71f
45 ; CHECK: Name: {{[0-9a-f]*}} "_ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE"
46 ; CHECK: Name: {{[0-9a-f]*}} "_ZN4llvm22MachineModuleInfoMachOD2Ev"
47
48 ; CHECK: Hash = 0x8c248979
49 ; CHECK: Name: {{[0-9a-f]*}} "setStmt"
50 ; CHECK: Name: {{[0-9a-f]*}} "_ZN4llvm5TwineC1Ei"
51
52
53
54 @ForceTopDown = common global i32 0, align 4
55 @_ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_ = common global i32 0, align 4
56 @_ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE = common global i32 0, align 4
57 @_ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv = common global i32 0, align 4
58 @_ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE = common global i32 0, align 4
59 @_ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE = common global i32 0, align 4
60 @k1 = common global i32 0, align 4
61 @is = common global i32 0, align 4
62 @setStmt = common global i32 0, align 4
63 @_ZN4llvm5TwineC1Ei = common global i32 0, align 4
64 @_ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE = common global i32 0, align 4
65 @_ZN4llvm22MachineModuleInfoMachOD2Ev = common global i32 0, align 4
66
67 !llvm.dbg.cu = !{!0}
68 !llvm.module.flags = !{!17, !18, !19}
69 !llvm.ident = !{!20}
70
71 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 231548) (llvm/trunk 231547)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2)
72 !1 = !DIFile(filename: "hash-collisions.c", directory: "/tmp")
73 !2 = !{}
74 !3 = !{!4, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16}
75 !4 = !DIGlobalVariable(name: "ForceTopDown", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, variable: i32* @ForceTopDown)
76 !5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
77 !6 = !DIGlobalVariable(name: "_ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, variable: i32* @_ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_)
78 !7 = !DIGlobalVariable(name: "_ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE", scope: !0, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, variable: i32* @_ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE)
79 !8 = !DIGlobalVariable(name: "_ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv", scope: !0, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true, variable: i32* @_ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv)
80 !9 = !DIGlobalVariable(name: "_ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE", scope: !0, file: !1, line: 5, type: !5, isLocal: false, isDefinition: true, variable: i32* @_ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE)
81 !10 = !DIGlobalVariable(name: "_ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE", scope: !0, file: !1, line: 6, type: !5, isLocal: false, isDefinition: true, variable: i32* @_ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE)
82 !11 = !DIGlobalVariable(name: "k1", scope: !0, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true, variable: i32* @k1)
83 !12 = !DIGlobalVariable(name: "is", scope: !0, file: !1, line: 8, type: !5, isLocal: false, isDefinition: true, variable: i32* @is)
84 !13 = !DIGlobalVariable(name: "setStmt", scope: !0, file: !1, line: 9, type: !5, isLocal: false, isDefinition: true, variable: i32* @setStmt)
85 !14 = !DIGlobalVariable(name: "_ZN4llvm5TwineC1Ei", scope: !0, file: !1, line: 10, type: !5, isLocal: false, isDefinition: true, variable: i32* @_ZN4llvm5TwineC1Ei)
86 !15 = !DIGlobalVariable(name: "_ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE", scope: !0, file: !1, line: 11, type: !5, isLocal: false, isDefinition: true, variable: i32* @_ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE)
87 !16 = !DIGlobalVariable(name: "_ZN4llvm22MachineModuleInfoMachOD2Ev", scope: !0, file: !1, line: 12, type: !5, isLocal: false, isDefinition: true, variable: i32* @_ZN4llvm22MachineModuleInfoMachOD2Ev)
88 !17 = !{i32 2, !"Dwarf Version", i32 2}
89 !18 = !{i32 2, !"Debug Info Version", i32 3}
90 !19 = !{i32 1, !"PIC Level", i32 2}
91 !20 = !{!"clang version 3.7.0 (trunk 231548) (llvm/trunk 231547)"}
0 ; RUN: %llc_dwarf -O0 < %s | FileCheck %s
1 ; Do not emit AT_upper_bound for an unbounded array.
2 ; radar 9241695
3 define i32 @main() nounwind ssp {
4 entry:
5 %retval = alloca i32, align 4
6 %a = alloca [0 x i32], align 4
7 store i32 0, i32* %retval
8 call void @llvm.dbg.declare(metadata [0 x i32]* %a, metadata !6, metadata !DIExpression()), !dbg !11
9 ret i32 0, !dbg !12
10 }
11
12 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
13
14 !llvm.dbg.cu = !{!2}
15 !llvm.module.flags = !{!16}
16
17 !0 = distinct !DISubprogram(name: "main", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 3, file: !14, scope: !1, type: !3, function: i32 ()* @main)
18 !1 = !DIFile(filename: "array.c", directory: "/private/tmp")
19 !2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 129138)", isOptimized: false, emissionKind: 0, file: !14, enums: !15, retainedTypes: !15, subprograms: !13, imports: null)
20 !3 = !DISubroutineType(types: !4)
21 !4 = !{!5}
22 !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
23 !6 = !DILocalVariable(name: "a", line: 4, scope: !7, file: !1, type: !8)
24 !7 = distinct !DILexicalBlock(line: 3, column: 12, file: !14, scope: !0)
25 !8 = !DICompositeType(tag: DW_TAG_array_type, align: 32, file: !14, scope: !2, baseType: !5, elements: !9)
26 !9 = !{!10}
27 ;CHECK: section_info:
28 ;CHECK: DW_TAG_subrange_type
29 ;CHECK-NEXT: DW_AT_type
30 ;CHECK-NOT: DW_AT_lower_bound
31 ;CHECK-NOT: DW_AT_upper_bound
32 ;CHECK-NEXT: End Of Children Mark
33 !10 = !DISubrange(count: -1)
34 !11 = !DILocation(line: 4, column: 7, scope: !7)
35 !12 = !DILocation(line: 5, column: 3, scope: !7)
36 !13 = !{!0}
37 !14 = !DIFile(filename: "array.c", directory: "/private/tmp")
38 !15 = !{}
39 !16 = !{i32 1, !"Debug Info Version", i32 3}
0 ; RUN: opt -S -asan %s | FileCheck %s
1
2 ; The IR of this testcase is generated from the following C code:
3 ; void bar (int);
4 ;
5 ; void foo() {
6 ; __block int x;
7 ; bar(x);
8 ; }
9 ; by compiling it with 'clang -emit-llvm -g -S' and then by manually
10 ; adding the sanitize_address attribute to the @foo() function (so
11 ; that ASAN accepts to instrument the function in the above opt run).
12
13 ; Check that the location of the ASAN instrumented __block variable is
14 ; correct.
15 ; CHECK: !DIExpression(DW_OP_deref, DW_OP_plus, 8, DW_OP_deref, DW_OP_plus, 24)
16
17 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
18
19 %struct.__block_byref_x = type { i8*, %struct.__block_byref_x*, i32, i32, i32 }
20
21 ; Function Attrs: nounwind ssp uwtable
22 define void @foo() #0 {
23 entry:
24 %x = alloca %struct.__block_byref_x, align 8
25 call void @llvm.dbg.declare(metadata %struct.__block_byref_x* %x, metadata !12, metadata !22), !dbg !23
26 %byref.isa = getelementptr inbounds %struct.__block_byref_x, %struct.__block_byref_x* %x, i32 0, i32 0, !dbg !24
27 store i8* null, i8** %byref.isa, !dbg !24
28 %byref.forwarding = getelementptr inbounds %struct.__block_byref_x, %struct.__block_byref_x* %x, i32 0, i32 1, !dbg !24
29 store %struct.__block_byref_x* %x, %struct.__block_byref_x** %byref.forwarding, !dbg !24
30 %byref.flags = getelementptr inbounds %struct.__block_byref_x, %struct.__block_byref_x* %x, i32 0, i32 2, !dbg !24
31 store i32 0, i32* %byref.flags, !dbg !24
32 %byref.size = getelementptr inbounds %struct.__block_byref_x, %struct.__block_byref_x* %x, i32 0, i32 3, !dbg !24
33 store i32 32, i32* %byref.size, !dbg !24
34 %forwarding = getelementptr inbounds %struct.__block_byref_x, %struct.__block_byref_x* %x, i32 0, i32 1, !dbg !25
35 %0 = load %struct.__block_byref_x*, %struct.__block_byref_x** %forwarding, !dbg !25
36 %x1 = getelementptr inbounds %struct.__block_byref_x, %struct.__block_byref_x* %0, i32 0, i32 4, !dbg !25
37 %1 = load i32, i32* %x1, align 4, !dbg !25
38 call void @bar(i32 %1), !dbg !25
39 %2 = bitcast %struct.__block_byref_x* %x to i8*, !dbg !26
40 call void @_Block_object_dispose(i8* %2, i32 8) #3, !dbg !26
41 ret void, !dbg !26
42 }
43
44 ; Function Attrs: nounwind readnone
45 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
46
47 declare void @bar(i32) #2
48
49 declare void @_Block_object_dispose(i8*, i32)
50
51 attributes #0 = { nounwind ssp uwtable sanitize_address "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
52 attributes #1 = { nounwind readnone }
53 attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
54 attributes #3 = { nounwind }
55
56 !llvm.dbg.cu = !{!0}
57 !llvm.module.flags = !{!8, !9, !10}
58 !llvm.ident = !{!11}
59
60 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 (trunk 223120) (llvm/trunk 223119)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
61 !1 = !DIFile(filename: "block.c", directory: "/tmp")
62 !2 = !{}
63 !3 = !{!4}
64 !4 = distinct !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, function: void ()* @foo, variables: !2)
65 !5 = !DIFile(filename: "block.c", directory: "/tmp")
66 !6 = !DISubroutineType(types: !7)
67 !7 = !{null}
68 !8 = !{i32 2, !"Dwarf Version", i32 2}
69 !9 = !{i32 2, !"Debug Info Version", i32 3}
70 !10 = !{i32 1, !"PIC Level", i32 2}
71 !11 = !{!"clang version 3.6.0 (trunk 223120) (llvm/trunk 223119)"}
72 !12 = !DILocalVariable(name: "x", line: 4, scope: !4, file: !5, type: !13)
73 !13 = !DICompositeType(tag: DW_TAG_structure_type, size: 224, flags: DIFlagBlockByrefStruct, file: !1, scope: !5, elements: !14)
74 !14 = !{!15, !17, !18, !20, !21}
75 !15 = !DIDerivedType(tag: DW_TAG_member, name: "__isa", size: 64, align: 64, file: !1, scope: !5, baseType: !16)
76 !16 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: null)
77 !17 = !DIDerivedType(tag: DW_TAG_member, name: "__forwarding", size: 64, align: 64, offset: 64, file: !1, scope: !5, baseType: !16)
78 !18 = !DIDerivedType(tag: DW_TAG_member, name: "__flags", size: 32, align: 32, offset: 128, file: !1, scope: !5, baseType: !19)
79 !19 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
80 !20 = !DIDerivedType(tag: DW_TAG_member, name: "__size", size: 32, align: 32, offset: 160, file: !1, scope: !5, baseType: !19)
81 !21 = !DIDerivedType(tag: DW_TAG_member, name: "x", size: 32, align: 32, offset: 192, file: !1, scope: !5, baseType: !19)
82 !22 = !DIExpression(DW_OP_plus, 8, DW_OP_deref, DW_OP_plus, 24)
83 !23 = !DILocation(line: 4, column: 15, scope: !4)
84 !24 = !DILocation(line: 4, column: 3, scope: !4)
85 !25 = !DILocation(line: 5, column: 3, scope: !4)
86 !26 = !DILocation(line: 6, column: 1, scope: !4)
0 ; RUN: llc < %s
1
2 !llvm.dbg.cu = !{!0}
3 !llvm.module.flags = !{!2}
4
5 !0 = distinct !DICompileUnit(language: DW_LANG_C99, isOptimized: false, emissionKind: 0, file: !1, globals: null)
6 !1 = !DIFile(filename: "t", directory: "")
7 !2 = !{i32 1, !"Debug Info Version", i32 3}
0 ; REQUIRES: object-emission
1
2 ; RUN: %llc_dwarf -O0 -filetype=obj %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
3
4 ; Ensure that pointer constants are emitted as unsigned data. Alternatively,
5 ; these could be signless data (dataN).
6
7 ; Built with Clang from:
8 ; template
9 ; void func() {}
10 ; template void func();
11
12 ; CHECK: DW_TAG_subprogram
13 ; CHECK: DW_TAG_template_value_parameter
14 ; CHECK: DW_AT_name {{.*}} "V"
15 ; CHECK: DW_AT_const_value [DW_FORM_udata] (0)
16 ; CHECK: DW_TAG_template_value_parameter
17 ; CHECK: DW_AT_name {{.*}} "F"
18 ; CHECK: DW_AT_const_value [DW_FORM_udata] (0)
19
20 ; Function Attrs: nounwind uwtable
21 define weak_odr void @_Z4funcILPv0ELPFvvE0ELi42EEvv() #0 {
22 entry:
23 ret void, !dbg !18
24 }
25
26 attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
27
28 !llvm.dbg.cu = !{!0}
29 !llvm.module.flags = !{!15, !16}
30 !llvm.ident = !{!17}
31
32 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
33 !1 = !DIFile(filename: "constant-pointers.cpp", directory: "/tmp/dbginfo")
34 !2 = !{}
35 !3 = !{!4}
36 !4 = distinct !DISubprogram(name: "func", linkageName: "_Z4funcILPv0ELPFvvE0ELi42EEvv", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: void ()* @_Z4funcILPv0ELPFvvE0ELi42EEvv, templateParams: !8, variables: !2)
37 !5 = !DIFile(filename: "constant-pointers.cpp", directory: "/tmp/dbginfo")
38 !6 = !DISubroutineType(types: !7)
39 !7 = !{null}
40 !8 = !{!9, !11, !13}
41 !9 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "V", type: !10, value: i8 0)
42 !10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: null)
43 !11 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "F", type: !12, value: i8 0)
44 !12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !6)
45 !13 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "i", type: !14, value: i32 42)
46 !14 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
47 !15 = !{i32 2, !"Dwarf Version", i32 4}
48 !16 = !{i32 2, !"Debug Info Version", i32 3}
49 !17 = !{!"clang version 3.5.0 "}
50 !18 = !DILocation(line: 3, scope: !4)
0 ; RUN: llc -debug < %s 2>&1 | FileCheck %s
1 ; REQUIRES: asserts
2
3 ; CHECK: 0x{{[0-9,a-f]+}}: i32 = Constant<-1>test.c:4:5
4
5 define i32 @main() {
6 entry:
7 %retval = alloca i32, align 4
8 store i32 0, i32* %retval
9 ret i32 -1, !dbg !10
10 }
11
12 !llvm.dbg.cu = !{!0}
13 !llvm.module.flags = !{!8, !9}
14
15 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, subprograms: !3)
16 !1 = !DIFile(filename: "test.c", directory: "/home/user/clang-llvm/build")
17 !2 = !{}
18 !3 = !{!4}
19 !4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, function: i32 ()* @main, variables: !2)
20 !5 = !DISubroutineType(types: !6)
21 !6 = !{!7}
22 !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
23 !8 = !{i32 2, !"Dwarf Version", i32 4}
24 !9 = !{i32 2, !"Debug Info Version", i32 3}
25 !10 = !DILocation(line: 4, column: 5, scope: !4)
0 ; RUN: llc -debug < %s 2>&1 | FileCheck %s
1 ; REQUIRES: asserts
2
3 ; CHECK: 0x{{[0-9,a-f]+}}: f64 = ConstantFP<1.500000e+00>test.c:3:5
4
5 define double @f() {
6 entry:
7 ret double 1.500000e+00, !dbg !10
8 }
9
10 !llvm.dbg.cu = !{!0}
11 !llvm.module.flags = !{!8, !9}
12
13 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, subprograms: !3)
14 !1 = !DIFile(filename: "test.c", directory: "/home/user/clang-llvm/build")
15 !2 = !{}
16 !3 = !{!4}
17 !4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, function: double ()* @f, variables: !2)
18 !5 = !DISubroutineType(types: !6)
19 !6 = !{!7}
20 !7 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float)
21 !8 = !{i32 2, !"Dwarf Version", i32 4}
22 !9 = !{i32 2, !"Debug Info Version", i32 3}
23 !10 = !DILocation(line: 3, column: 5, scope: !4)
0 ; REQUIRES: object-emission
1
2 ; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=Enable < %s | llvm-dwarfdump -debug-dump=info - | FileCheck -implicit-check-not=DW_TAG %s
3 ; RUN: %llc_dwarf -dwarf-accel-tables=Enable -dwarf-linkage-names=Enable -O0 -filetype=obj < %s | llvm-dwarfdump - | FileCheck --check-prefix=CHECK-ACCEL --check-prefix=CHECK %s
4
5 ; Build from source:
6 ; $ clang++ a.cpp b.cpp -g -c -emit-llvm
7 ; $ llvm-link a.bc b.bc -o ab.bc
8 ; $ opt -inline ab.bc -o ab-opt.bc
9 ; $ cat a.cpp
10 ; extern int i;
11 ; int func(int);
12 ; int main() {
13 ; return func(i);
14 ; }
15 ; $ cat b.cpp
16 ; int __attribute__((always_inline)) func(int x) {
17 ; return x * 2;
18 ; }
19
20 ; Ensure that func inlined into main is described and references the abstract
21 ; definition in b.cpp's CU.
22
23 ; CHECK: DW_TAG_compile_unit
24 ; CHECK: DW_AT_name {{.*}} "a.cpp"
25 ; CHECK: DW_TAG_subprogram
26 ; CHECK: DW_AT_type [DW_FORM_ref_addr] (0x00000000[[INT:.*]])
27 ; CHECK: 0x[[INLINED:[0-9a-f]*]]:{{.*}}DW_TAG_inlined_subroutine
28 ; CHECK: DW_AT_abstract_origin {{.*}}[[ABS_FUNC:........]] "_Z4funci"
29 ; CHECK: DW_TAG_formal_parameter
30 ; CHECK: DW_AT_abstract_origin {{.*}}[[ABS_VAR:........]] "x"
31
32 ; Check the abstract definition is in the 'b.cpp' CU and doesn't contain any
33 ; concrete information (address range or variable location)
34 ; CHECK: DW_TAG_compile_unit
35 ; CHECK: DW_AT_name {{.*}} "b.cpp"
36 ; CHECK: 0x[[ABS_FUNC]]: DW_TAG_subprogram
37 ; CHECK-NOT: DW_AT_low_pc
38 ; CHECK: 0x[[ABS_VAR]]: DW_TAG_formal_parameter
39 ; CHECK-NOT: DW_AT_location
40 ; CHECK: DW_AT_type [DW_FORM_ref4] {{.*}} {0x[[INT]]}
41 ; CHECK-NOT: DW_AT_location
42
43 ; CHECK: 0x[[INT]]: DW_TAG_base_type
44 ; CHECK: DW_AT_name {{.*}} "int"
45
46 ; Check the concrete out of line definition references the abstract and
47 ; provides the address range and variable location
48 ; CHECK: 0x[[FUNC:[0-9a-f]*]]{{.*}}DW_TAG_subprogram
49 ; CHECK: DW_AT_low_pc
50 ; CHECK: DW_AT_abstract_origin {{.*}} {0x[[ABS_FUNC]]} "_Z4funci"
51 ; CHECK: DW_TAG_formal_parameter
52 ; CHECK: DW_AT_location
53 ; CHECK: DW_AT_abstract_origin {{.*}} {0x[[ABS_VAR]]} "x"
54
55 ; Check that both the inline and the non out of line version of func are
56 ; correctly referenced in the accelerator table. Before r221837, the one
57 ; in the second compilation unit had a wrong offset
58 ; CHECK-ACCEL: .apple_names contents:
59 ; CHECK-ACCEL: Name{{.*}}"func"
60 ; CHECK-ACCEL-NOT: Name
61 ; CHECK-ACCEL: Atom[0]{{.*}}[[INLINED]]
62 ; CHECK-ACCEL-NOT: Name
63 ; CHECK-ACCEL: Atom[0]{{.*}}[[FUNC]]
64
65 @i = external global i32
66
67 ; Function Attrs: uwtable
68 define i32 @main() #0 {
69 entry:
70 %x.addr.i = alloca i32, align 4
71 %retval = alloca i32, align 4
72 store i32 0, i32* %retval
73 %0 = load i32, i32* @i, align 4, !dbg !19
74 %1 = bitcast i32* %x.addr.i to i8*
75 call void @llvm.lifetime.start(i64 4, i8* %1)
76 store i32 %0, i32* %x.addr.i, align 4
77 call void @llvm.dbg.declare(metadata i32* %x.addr.i, metadata !120, metadata !DIExpression()), !dbg !21
78 %2 = load i32, i32* %x.addr.i, align 4, !dbg !22
79 %mul.i = mul nsw i32 %2, 2, !dbg !22
80 %3 = bitcast i32* %x.addr.i to i8*, !dbg !22
81 call void @llvm.lifetime.end(i64 4, i8* %3), !dbg !22
82 ret i32 %mul.i, !dbg !19
83 }
84
85 ; Function Attrs: alwaysinline nounwind uwtable
86 define i32 @_Z4funci(i32 %x) #1 {
87 entry:
88 %x.addr = alloca i32, align 4
89 store i32 %x, i32* %x.addr, align 4
90 call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !20, metadata !DIExpression()), !dbg !23
91 %0 = load i32, i32* %x.addr, align 4, !dbg !24
92 %mul = mul nsw i32 %0, 2, !dbg !24
93 ret i32 %mul, !dbg !24
94 }
95
96 ; Function Attrs: nounwind readnone
97 declare void @llvm.dbg.declare(metadata, metadata, metadata) #2
98
99 ; Function Attrs: nounwind
100 declare void @llvm.lifetime.start(i64, i8* nocapture) #3
101
102 ; Function Attrs: nounwind
103 declare void @llvm.lifetime.end(i64, i8* nocapture) #3
104
105 attributes #0 = { uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
106 attributes #1 = { alwaysinline nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
107 attributes #2 = { nounwind readnone }
108 attributes #3 = { nounwind }
109
110 !llvm.dbg.cu = !{!0, !9}
111 !llvm.module.flags = !{!16, !17}
112 !llvm.ident = !{!18, !18}
113
114 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
115 !1 = !DIFile(filename: "a.cpp", directory: "/tmp/dbginfo")
116 !2 = !{}
117 !3 = !{!4}
118 !4 = distinct !DISubprogram(name: "main", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !2)
119 !5 = !DIFile(filename: "a.cpp", directory: "/tmp/dbginfo")
120 !6 = !DISubroutineType(types: !7)
121 !7 = !{!8}
122 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
123 !9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !10, enums: !2, retainedTypes: !2, subprograms: !11, globals: !2, imports: !2)
124 !10 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo")
125 !11 = !{!12}
126 !12 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !10, scope: !13, type: !14, function: i32 (i32)* @_Z4funci, variables: !2)
127 !13 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo")
128 !14 = !DISubroutineType(types: !15)
129 !15 = !{!8, !8}
130 !16 = !{i32 2, !"Dwarf Version", i32 4}
131 !17 = !{i32 2, !"Debug Info Version", i32 3}
132 !18 = !{!"clang version 3.5.0 "}
133 !19 = !DILocation(line: 4, scope: !4)
134 !20 = !DILocalVariable(name: "x", line: 1, arg: 1, scope: !12, file: !13, type: !8)
135
136 !120 = !DILocalVariable(name: "x", line: 1, arg: 1, scope: !12, file: !13, type: !8)
137
138 !21 = !DILocation(line: 1, scope: !12, inlinedAt: !19)
139 !22 = !DILocation(line: 2, scope: !12, inlinedAt: !19)
140 !23 = !DILocation(line: 1, scope: !12)
141 !24 = !DILocation(line: 2, scope: !12)
142
0 ; REQUIRES: object-emission
1
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
3
4 ; Testing that two distinct (distinct by writing them in separate files, while
5 ; still fulfilling C++'s ODR by having identical token sequences) functions,
6 ; linked under LTO, get plausible debug info (and don't crash).
7
8 ; Built from source:
9 ; $ clang++ a.cpp b.cpp -g -c -emit-llvm
10 ; $ llvm-link a.bc b.bc -o ab.bc
11
12 ; This change is intended to tickle a case where the subprogram MDNode
13 ; associated with the llvm::Function will differ from the subprogram
14 ; referenced by the DbgLocs in the function.
15
16 ; $ sed -ie "s/!12, !0/!0, !12/" ab.ll
17 ; $ cat a.cpp
18 ; inline int func(int i) {
19 ; return i * 2;
20 ; }
21 ; int (*x)(int) = &func;
22 ; $ cat b.cpp
23 ; inline int func(int i) {
24 ; return i * 2;
25 ; }
26 ; int (*y)(int) = &func;
27
28 ; CHECK: DW_TAG_compile_unit
29 ; CHECK: DW_TAG_subprogram
30 ; CHECK-NOT: DW_TAG
31 ; CHECK: DW_AT_name {{.*}} "func"
32 ; CHECK: DW_TAG_compile_unit
33
34 ; FIXME: Maybe we should drop the subprogram here - since the function was
35 ; emitted in one CU, due to linkonce_odr uniquing. We certainly don't emit the
36 ; subprogram here if the source location for this definition is the same (see
37 ; test/DebugInfo/cross-cu-linkonce.ll), though it's very easy to tickle that
38 ; into failing even without duplicating the source as has been done in this
39 ; case (two cpp files in different directories, including the same header that
40 ; contains an inline function - clang will produce distinct subprogram metadata
41 ; that won't deduplicate owing to the file location information containing the
42 ; directory of the source file even though the file name is absolute, not
43 ; relative)
44
45 ; CHECK: DW_TAG_subprogram
46
47 @x = global i32 (i32)* @_Z4funci, align 8
48 @y = global i32 (i32)* @_Z4funci, align 8
49
50 ; Function Attrs: inlinehint nounwind uwtable
51 define linkonce_odr i32 @_Z4funci(i32 %i) #0 {
52 %1 = alloca i32, align 4
53 store i32 %i, i32* %1, align 4
54 call void @llvm.dbg.declare(metadata i32* %1, metadata !22, metadata !DIExpression()), !dbg !23
55 %2 = load i32, i32* %1, align 4, !dbg !24
56 %3 = mul nsw i32 %2, 2, !dbg !24
57 ret i32 %3, !dbg !24
58 }
59
60 ; Function Attrs: nounwind readnone
61 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
62
63 attributes #0 = { inlinehint nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
64 attributes #1 = { nounwind readnone }
65
66 !llvm.dbg.cu = !{!12, !0}
67 !llvm.module.flags = !{!19, !20}
68 !llvm.ident = !{!21, !21}
69
70 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !9, imports: !2)
71 !1 = !DIFile(filename: "a.cpp", directory: "/tmp/dbginfo")
72 !2 = !{}
73 !3 = !{!4}
74 !4 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 (i32)* @_Z4funci, variables: !2)
75 !5 = !DIFile(filename: "a.cpp", directory: "/tmp/dbginfo")
76 !6 = !DISubroutineType(types: !7)
77 !7 = !{!8, !8}
78 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
79 !9 = !{!10}
80 !10 = !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !5, type: !11, variable: i32 (i32)** @x)
81 !11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !6)
82 !12 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !13, enums: !2, retainedTypes: !2, subprograms: !14, globals: !17, imports: !2)
83 !13 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo")
84 !14 = !{!15}
85 !15 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !13, scope: !16, type: !6, function: i32 (i32)* @_Z4funci, variables: !2)
86 !16 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo")
87 !17 = !{!18}
88 !18 = !DIGlobalVariable(name: "y", line: 4, isLocal: false, isDefinition: true, scope: null, file: !16, type: !11, variable: i32 (i32)** @y)
89 !19 = !{i32 2, !"Dwarf Version", i32 4}
90 !20 = !{i32 1, !"Debug Info Version", i32 3}
91 !21 = !{!"clang version 3.5.0 "}
92 !22 = !DILocalVariable(name: "i", line: 1, arg: 1, scope: !4, file: !5, type: !8)
93 !23 = !DILocation(line: 1, scope: !4)
94 !24 = !DILocation(line: 2, scope: !4)
0 ; REQUIRES: object-emission
1
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
3
4 ; Built from source:
5 ; $ clang++ a.cpp b.cpp -g -c -emit-llvm
6 ; $ llvm-link a.bc b.bc -o ab.bc
7 ; $ cat a.cpp
8 ; # 1 "func.h"
9 ; inline int func(int i) {
10 ; return i * 2;
11 ; }
12 ; int (*x)(int) = &func;
13 ; $ cat b.cpp
14 ; # 1 "func.h"
15 ; inline int func(int i) {
16 ; return i * 2;
17 ; }
18 ; int (*y)(int) = &func;
19
20 ; CHECK: DW_TAG_compile_unit
21 ; CHECK: DW_TAG_subprogram
22 ; CHECK-NOT: DW_TAG
23 ; CHECK: DW_AT_name {{.*}} "func"
24 ; CHECK: DW_TAG_compile_unit
25 ; CHECK-NOT: DW_TAG_subprogram
26
27 @x = global i32 (i32)* @_Z4funci, align 8
28 @y = global i32 (i32)* @_Z4funci, align 8
29
30 ; Function Attrs: inlinehint nounwind uwtable
31 define linkonce_odr i32 @_Z4funci(i32 %i) #0 {
32 %1 = alloca i32, align 4
33 store i32 %i, i32* %1, align 4
34 call void @llvm.dbg.declare(metadata i32* %1, metadata !20, metadata !DIExpression()), !dbg !21
35 %2 = load i32, i32* %1, align 4, !dbg !22
36 %3 = mul nsw i32 %2, 2, !dbg !22
37 ret i32 %3, !dbg !22
38 }
39
40 ; Function Attrs: nounwind readnone
41 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
42
43 attributes #0 = { inlinehint nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
44 attributes #1 = { nounwind readnone }
45
46 !llvm.dbg.cu = !{!0, !13}
47 !llvm.module.flags = !{!17, !18}
48 !llvm.ident = !{!19, !19}
49
50 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !10, imports: !2)
51 !1 = !DIFile(filename: "a.cpp", directory: "/tmp/dbginfo")
52 !2 = !{}
53 !3 = !{!4}
54 !4 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !5, scope: !6, type: !7, function: i32 (i32)* @_Z4funci, variables: !2)
55 !5 = !DIFile(filename: "func.h", directory: "/tmp/dbginfo")
56 !6 = !DIFile(filename: "func.h", directory: "/tmp/dbginfo")
57 !7 = !DISubroutineType(types: !8)
58 !8 = !{!9, !9}
59 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
60 !10 = !{!11}
61 !11 = !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !6, type: !12, variable: i32 (i32)** @x)
62 !12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !7)
63 !13 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !14, enums: !2, retainedTypes: !2, subprograms: !3, globals: !15, imports: !2)
64 !14 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo")
65 !15 = !{!16}
66 !16 = !DIGlobalVariable(name: "y", line: 4, isLocal: false, isDefinition: true, scope: null, file: !6, type: !12, variable: i32 (i32)** @y)
67 !17 = !{i32 2, !"Dwarf Version", i32 4}
68 !18 = !{i32 1, !"Debug Info Version", i32 3}
69 !19 = !{!"clang version 3.5.0 "}
70 !20 = !DILocalVariable(name: "i", line: 1, arg: 1, scope: !4, file: !6, type: !9)
71 !21 = !DILocation(line: 1, scope: !4)
72 !22 = !DILocation(line: 2, scope: !4)
0 ; REQUIRES: object-emission
1 ; RUN: %llc_dwarf -O0 -filetype=obj %s -o %t
2 ; RUN: llvm-dwarfdump %t | FileCheck %s
3
4 ; Check that we emit ranges for this CU since we have a function with and
5 ; without debug info.
6 ; Note: This depends upon the order of output in the .o file. Currently it's
7 ; in order of the output to make sure that the CU has multiple ranges since
8 ; there's a function in the middle. If they were together then it would have
9 ; a single range and no DW_AT_ranges.
10 ; CHECK: DW_TAG_compile_unit
11 ; CHECK: DW_AT_ranges
12 ; CHECK: DW_TAG_subprogram
13 ; CHECK: DW_TAG_subprogram
14
15 ; Function Attrs: nounwind uwtable
16 define i32 @b(i32 %c) #0 {
17 entry:
18 %c.addr = alloca i32, align 4
19 store i32 %c, i32* %c.addr, align 4
20 call void @llvm.dbg.declare(metadata i32* %c.addr, metadata !13, metadata !DIExpression()), !dbg !14
21 %0 = load i32, i32* %c.addr, align 4, !dbg !14
22 %add = add nsw i32 %0, 1, !dbg !14
23 ret i32 %add, !dbg !14
24 }
25
26 ; Function Attrs: nounwind uwtable
27 define i32 @a(i32 %b) #0 {
28 entry:
29 %b.addr = alloca i32, align 4
30 store i32 %b, i32* %b.addr, align 4
31 %0 = load i32, i32* %b.addr, align 4
32 %add = add nsw i32 %0, 1
33 ret i32 %add
34 }
35
36 ; Function Attrs: nounwind readnone
37 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
38
39 ; Function Attrs: nounwind uwtable
40 define i32 @d(i32 %e) #0 {
41 entry:
42 %e.addr = alloca i32, align 4
43 store i32 %e, i32* %e.addr, align 4
44 call void @llvm.dbg.declare(metadata i32* %e.addr, metadata !15, metadata !DIExpression()), !dbg !16
45 %0 = load i32, i32* %e.addr, align 4, !dbg !16
46 %add = add nsw i32 %0, 1, !dbg !16
47 ret i32 %add, !dbg !16
48 }
49
50 attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
51 attributes #1 = { nounwind readnone }
52
53 !llvm.ident = !{!0, !0}
54 !llvm.dbg.cu = !{!1}
55 !llvm.module.flags = !{!11, !12}
56
57 !0 = !{!"clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)"}
58 !1 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)", isOptimized: false, emissionKind: 1, file: !2, enums: !3, retainedTypes: !3, subprograms: !4, globals: !3, imports: !3)
59 !2 = !DIFile(filename: "b.c", directory: "/usr/local/google/home/echristo")
60 !3 = !{}
61 !4 = !{!5, !10}
62 !5 = distinct !DISubprogram(name: "b", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !2, scope: !6, type: !7, function: i32 (i32)* @b, variables: !3)
63 !6 = !DIFile(filename: "b.c", directory: "/usr/local/google/home/echristo")
64 !7 = !DISubroutineType(types: !8)
65 !8 = !{!9, !9}
66 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
67 !10 = distinct !DISubprogram(name: "d", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !2, scope: !6, type: !7, function: i32 (i32)* @d, variables: !3)
68 !11 = !{i32 2, !"Dwarf Version", i32 4}
69 !12 = !{i32 1, !"Debug Info Version", i32 3}
70 !13 = !DILocalVariable(name: "c", line: 1, arg: 1, scope: !5, file: !6, type: !9)
71 !14 = !DILocation(line: 1, scope: !5)
72 !15 = !DILocalVariable(name: "e", line: 3, arg: 1, scope: !10, file: !6, type: !9)
73 !16 = !DILocation(line: 3, scope: !10)
0 ; REQUIRES: object-emission
1 ; RUN: %llc_dwarf -O0 -filetype=obj %s -o %t
2 ; RUN: llvm-dwarfdump %t | FileCheck %s
3
4 ; Check that we emit ranges for this which has a non-traditional section and a normal section.
5
6 ; CHECK: DW_TAG_compile_unit
7 ; CHECK: DW_AT_ranges
8 ; CHECK: DW_TAG_subprogram
9 ; CHECK: DW_AT_low_pc
10 ; CHECK: DW_AT_high_pc
11 ; CHECK: DW_TAG_subprogram
12 ; CHECK: DW_AT_low_pc
13 ; CHECK: DW_AT_high_pc
14
15 ; CHECK: .debug_ranges contents:
16 ; FIXME: When we get better dumping facilities we'll want to elaborate here.
17 ; CHECK: 00000000
18
19 ; Function Attrs: nounwind uwtable
20 define i32 @foo(i32 %a) #0 section "__TEXT,__foo" {
21 entry:
22 %a.addr = alloca i32, align 4
23 store i32 %a, i32* %a.addr, align 4
24 call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !13, metadata !DIExpression()), !dbg !14
25 %0 = load i32, i32* %a.addr, align 4, !dbg !15
26 %add = add nsw i32 %0, 5, !dbg !15
27 ret i32 %add, !dbg !15
28 }
29
30 ; Function Attrs: nounwind readnone
31 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
32
33 ; Function Attrs: nounwind uwtable
34 define i32 @bar(i32 %a) #0 {
35 entry:
36 %a.addr = alloca i32, align 4
37 store i32 %a, i32* %a.addr, align 4
38 call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !16, metadata !DIExpression()), !dbg !17
39 %0 = load i32, i32* %a.addr, align 4, !dbg !18
40 %add = add nsw i32 %0, 5, !dbg !18
41 ret i32 %add, !dbg !18
42 }
43
44 attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
45 attributes #1 = { nounwind readnone }
46
47 !llvm.dbg.cu = !{!0}
48 !llvm.module.flags = !{!10, !11}
49 !llvm.ident = !{!12}
50
51 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
52 !1 = !DIFile(filename: "foo.c", directory: "/usr/local/google/home/echristo")
53 !2 = !{}
54 !3 = !{!4, !9}
55 !4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 (i32)* @foo, variables: !2)
56 !5 = !DIFile(filename: "foo.c", directory: "/usr/local/google/home/echristo")
57 !6 = !DISubroutineType(types: !7)
58 !7 = !{!8, !8}
59 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
60 !9 = distinct !DISubprogram(name: "bar", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !5, type: !6, function: i32 (i32)* @bar, variables: !2)
61 !10 = !{i32 2, !"Dwarf Version", i32 4}
62 !11 = !{i32 1, !"Debug Info Version", i32 3}
63 !12 = !{!"clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)"}
64 !13 = !DILocalVariable(name: "a", line: 1, arg: 1, scope: !4, file: !5, type: !8)
65 !14 = !DILocation(line: 1, scope: !4)
66 !15 = !DILocation(line: 2, scope: !4)
67 !16 = !DILocalVariable(name: "a", line: 5, arg: 1, scope: !9, file: !5, type: !8)
68 !17 = !DILocation(line: 5, scope: !9)
69 !18 = !DILocation(line: 6, scope: !9)
70
0 ; RUN: llc < %s | FileCheck %s
1 ; Radar 10147769
2 ; Do not unnecessarily use AT_specification DIE.
3 ; CHECK-NOT: AT_specification
4
5 @a = common global [10 x i32] zeroinitializer, align 16
6
7 !llvm.dbg.cu = !{!0}
8 !llvm.module.flags = !{!12}
9
10 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 140253)", isOptimized: true, emissionKind: 0, file: !11, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3)
11 !2 = !{}
12 !3 = !{!5}
13 !5 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: [10 x i32]* @a)
14 !6 = !DIFile(filename: "x.c", directory: "/private/tmp")
15 !7 = !DICompositeType(tag: DW_TAG_array_type, size: 320, align: 32, baseType: !8, elements: !9)
16 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
17 !9 = !{!10}
18 !10 = !DISubrange(count: 10)
19 !11 = !DIFile(filename: "x.c", directory: "/private/tmp")
20 !12 = !{i32 1, !"Debug Info Version", i32 3}
0 ; REQUIRES: object-emission
1
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
3
4 ; Built from the following source with clang -O1
5 ; struct S { int i; };
6 ; int function(struct S s, int i) { return s.i + i; }
7
8 ; Due to the X86_64 ABI, 's' is passed in registers and once optimized, the
9 ; entirety of 's' is never reconstituted, since only the int is required, and
10 ; thus the variable's location is unknown/dead to debug info.
11
12 ; Future/current work should enable us to describe partial variables, which, in
13 ; this case, happens to be the entire variable.
14
15 ; CHECK: DW_TAG_subprogram
16 ; CHECK-NOT: DW_TAG
17 ; CHECK: DW_AT_name {{.*}} "function"
18 ; CHECK-NOT: {{DW_TAG|NULL}}
19 ; CHECK: DW_TAG_formal_parameter
20 ; CHECK-NOT: DW_TAG
21 ; CHECK: DW_AT_name {{.*}} "s"
22 ; CHECK-NOT: DW_TAG
23 ; FIXME: Even though 's' is never reconstituted into a struct, the one member
24 ; variable is still live and used, and so we should be able to describe 's's
25 ; location as the location of that int.
26 ; CHECK-NOT: DW_AT_location
27 ; CHECK-NOT: {{DW_TAG|NULL}}
28 ; CHECK: DW_TAG_formal_parameter
29 ; CHECK-NOT: DW_TAG
30 ; CHECK: DW_AT_location
31 ; CHECK-NOT: DW_TAG
32 ; CHECK: DW_AT_name {{.*}} "i"
33
34
35 %struct.S = type { i32 }
36
37 ; Function Attrs: nounwind readnone uwtable
38 define i32 @_Z8function1Si(i32 %s.coerce, i32 %i) #0 {
39 entry:
40 tail call void @llvm.dbg.declare(metadata %struct.S* undef, metadata !14, metadata !DIExpression()), !dbg !20
41 tail call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !15, metadata !DIExpression()), !dbg !20
42 %add = add nsw i32 %i, %s.coerce, !dbg !20
43 ret i32 %add, !dbg !20
44 }
45
46 ; Function Attrs: nounwind readnone
47 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
48
49 ; Function Attrs: nounwind readnone
50 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
51
52 attributes #0 = { nounwind readnone uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
53 attributes #1 = { nounwind readnone }
54
55 !llvm.dbg.cu = !{!0}
56 !llvm.module.flags = !{!16, !17}
57 !llvm.ident = !{!18}
58
59 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !8, globals: !2, imports: !2)
60 !1 = !DIFile(filename: "dead-argument-order.cpp", directory: "/tmp/dbginfo")
61 !2 = !{}
62 !3 = !{!4}
63 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", line: 1, size: 32, align: 32, file: !1, elements: !5, identifier: "_ZTS1S")
64 !5 = !{!6}
65 !6 = !DIDerivedType(tag: DW_TAG_member, name: "i", line: 1, size: 32, align: 32, file: !1, scope: !"_ZTS1S", baseType: !7)
66 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
67 !8 = !{!9}
68 !9 = distinct !DISubprogram(name: "function", linkageName: "_Z8function1Si", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !1, scope: !10, type: !11, function: i32 (i32, i32)* @_Z8function1Si, variables: !13)
69 !10 = !DIFile(filename: "dead-argument-order.cpp", directory: "/tmp/dbginfo")
70 !11 = !DISubroutineType(types: !12)
71 !12 = !{!7, !4, !7}
72 !13 = !{!14, !15}
73 !14 = !DILocalVariable(name: "s", line: 2, arg: 1, scope: !9, file: !10, type: !"_ZTS1S")
74 !15 = !DILocalVariable(name: "i", line: 2, arg: 2, scope: !9, file: !10, type: !7)
75 !16 = !{i32 2, !"Dwarf Version", i32 4}
76 !17 = !{i32 2, !"Debug Info Version", i32 3}
77 !18 = !{!"clang version 3.5.0 "}
78 !19 = !{%struct.S* undef}
79 !20 = !DILocation(line: 2, scope: !9)
80
0 ; RUN: opt < %s -always-inline -S | FileCheck %s
1 ;
2 ; Generated from the following C++ source with:
3 ; clang -cc1 -disable-llvm-optzns -emit-llvm -g -stack-protector 2 test.cpp
4 ;
5 ; /* BEGIN SOURCE */
6 ; int __attribute__((always_inline)) foo()
7 ; {
8 ; int arr[10];
9 ; arr[0] = 5;
10 ; int sum = 4;
11 ; return sum;
12 ; }
13 ;
14 ; extern void bar();
15 ;
16 ; int main()
17 ; {
18 ; bar();
19 ; int i = foo();
20 ; return i;
21 ; }
22 ; /* END SOURCE */
23
24 ; The patch that includes this test case, is addressing the following issue:
25 ;
26 ; When functions are inlined, instructions without debug information
27 ; are attributed with the call site's DebugLoc. After inlining, inlined static
28 ; allocas are moved to the caller's entry block, adjacent to the caller's original
29 ; static alloca instructions. By retaining the call site's DebugLoc, these instructions
30 ; may cause instructions that are subsequently inserted at the entry block to pick
31 ; up the same DebugLoc.
32 ;
33 ; In the offending case stack protection inserts an instruction at the caller's
34 ; entry block, which inadvertently picks up the inlined call's DebugLoc, because
35 ; the entry block's first instruction is the recently moved inlined alloca instruction.
36 ;
37 ; The stack protection instruction then becomes part of the function prologue, with the
38 ; result that the line number that is associated with the stack protection instruction
39 ; is deemed to be the end of the function prologue. Since this line number is the
40 ; call site's line number, setting a breakpoint at the function in the debugger
41 ; will make the user stop at the line of the inlined call.
42
43 ; Note that without the stack protection instruction this effect would not occur
44 ; because the allocas all get collapsed into a single instruction that reserves
45 ; stack space and have no further influence on the prologue's line number information.
46
47
48 ; The selected solution is to not attribute static allocas with the call site's
49 ; DebugLoc.
50
51 ; At some point in the future, it may be desirable to describe the inlining
52 ; in the alloca instructions, but then the code that handles prologues must
53 ; be able to handle this correctly, including the late insertion of instructions
54 ; into it.
55
56 ; In this context it is also important to distingush between functions
57 ; with the "nodebug" attribute and those without it. Alloca instructions from
58 ; nodebug functions should continue to have no DebugLoc, whereas those from
59 ; non-nodebug functions (i.e. functions with debug information) may want to
60 ; have their DebugLocs augmented with inlining information.
61
62
63 ; Make sure that after inlining the call to foo() the alloca instructions for
64 ; arr.i and sum.i do not retain debug information.
65
66 ; CHECK: %arr.i = alloca [10 x i32], align {{[0-9]*$}}
67 ; CHECK: %sum.i = alloca i32, align {{[0-9]*$}}
68
69
70 ; ModuleID = 'test.cpp'
71 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
72 target triple = "x86_64-unknown-linux-gnu"
73
74 ; Function Attrs: alwaysinline nounwind sspstrong
75 define i32 @_Z3foov() #0 {
76 entry:
77 %arr = alloca [10 x i32], align 16
78 %sum = alloca i32, align 4
79 call void @llvm.dbg.declare(metadata [10 x i32]* %arr, metadata !14), !dbg !18
80 %arrayidx = getelementptr inbounds [10 x i32], [10 x i32]* %arr, i32 0, i64 0, !dbg !19
81 store i32 5, i32* %arrayidx, align 4, !dbg !19
82 call void @llvm.dbg.declare(metadata i32* %sum, metadata !20), !dbg !21
83 store i32 4, i32* %sum, align 4, !dbg !21
84 %0 = load i32, i32* %sum, align 4, !dbg !22
85 ret i32 %0, !dbg !22
86 }
87
88 ; Function Attrs: nounwind readnone
89 declare void @llvm.dbg.declare(metadata, metadata) #1
90
91 ; Function Attrs: nounwind sspstrong
92 define i32 @main() #2 {
93 entry:
94 %retval = alloca i32, align 4
95 %i = alloca i32, align 4
96 store i32 0, i32* %retval
97 call void @_Z3barv(), !dbg !23
98 call void @llvm.dbg.declare(metadata i32* %i, metadata !24), !dbg !25
99 %call = call i32 @_Z3foov(), !dbg !25
100 store i32 %call, i32* %i, align 4, !dbg !25
101 %0 = load i32, i32* %i, align 4, !dbg !26
102 ret i32 %0, !dbg !26
103 }
104
105 declare void @_Z3barv() #3
106
107 attributes #0 = { alwaysinline nounwind sspstrong "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
108 attributes #1 = { nounwind readnone }
109 attributes #2 = { nounwind sspstrong "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
110 attributes #3 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
111
112 !llvm.dbg.cu = !{!0}
113 !llvm.module.flags = !{!11, !12}
114 !llvm.ident = !{!13}
115
116 !0 = !{i32 786449, !1, i32 4, !"clang version 3.6.0 (217844)", i1 false, !"", i32 0, !2, !2, !3, !2, !2, !"", i32 1} ; [ DW_TAG_compile_unit ] [/home/user/test/] [DW_LANG_C_plus_plus]
117 !1 = !{!"", !"/home/user/test"}
118 !2 = !{}
119 !3 = !{!4, !10}
120 !4 = !{i32 786478, !5, !6, !"foo", !"foo", !"_Z3foov", i32 1, !7, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 ()* @_Z3foov, null, null, !2, i32 2} ; [ DW_TAG_subprogram ] [line 1] [def] [scope 2] [foo]
121 !5 = !{!"test.cpp", !"/home/user/test"}
122 !6 = !{i32 786473, !5} ; [ DW_TAG_file_type ] [/home/user/test/test.cpp]
123 !7 = !{i32 786453, i32 0, null, !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, !8, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
124 !8 = !{!9}
125 !9 = !{i32 786468, null, null, !"int", i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
126 !10 = !{i32 786478, !5, !6, !"main", !"main", !"", i32 11, !7, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 ()* @main, null, null, !2, i32 12} ; [ DW_TAG_subprogram ] [line 11] [def] [scope 12] [main]
127 !11 = !{i32 2, !"Dwarf Version", i32 4}
128 !12 = !{i32 2, !"Debug Info Version", i32 1}
129 !13 = !{!"clang version 3.6.0 (217844)"}
130 !14 = !{i32 786688, !4, !"arr", !6, i32 3, !15, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [arr] [line 3]
131 !15 = !{i32 786433, null, null, !"", i32 0, i64 320, i64 32, i32 0, i32 0, !9, !16, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 320, align 32, offset 0] [from int]
132 !16 = !{!17}
133 !17 = !{i32 786465, i64 0, i64 10} ; [ DW_TAG_subrange_type ] [0, 9]
134 !18 = !DILocation(line: 3, scope: !4)
135 !19 = !DILocation(line: 4, scope: !4)
136 !20 = !{i32 786688, !4, !"sum", !6, i32 5, !9, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [sum] [line 5]
137 !21 = !DILocation(line: 5, scope: !4)
138 !22 = !DILocation(line: 6, scope: !4)
139 !23 = !DILocation(line: 13, scope: !10)
140 !24 = !{i32 786688, !10, !"i", !6, i32 14, !9, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [i] [line 14]
141 !25 = !DILocation(line: 14, scope: !10)
142 !26 = !DILocation(line: 15, scope: !10)
0 ; REQUIRES: object-emission
1 ; Test (r)value qualifiers on C++11 non-static member functions.
2 ; Generated from tools/clang/test/CodeGenCXX/debug-info-qualifiers.cpp
3 ;
4 ; class A {
5 ; public:
6 ; void l() const &;
7 ; void r() const &&;
8 ; };
9 ;
10 ; void g() {
11 ; A a;
12 ; auto pl = &A::l;
13 ; auto pr = &A::r;
14 ; }
15 ;
16 ; RUN: %llc_dwarf -filetype=obj -O0 < %s | llvm-dwarfdump - | FileCheck %s
17 ; CHECK: DW_TAG_subroutine_type DW_CHILDREN_yes
18 ; CHECK-NEXT: DW_AT_reference DW_FORM_flag_present
19 ; CHECK: DW_TAG_subroutine_type DW_CHILDREN_yes
20 ; CHECK-NEXT: DW_AT_rvalue_reference DW_FORM_flag_present
21 ;
22 ; CHECK: DW_TAG_subprogram
23 ; CHECK-NOT: DW_TAG_subprogram
24 ; CHECK: DW_AT_name {{.*}}"l"
25 ; CHECK-NOT: DW_TAG_subprogram
26 ; CHECK: DW_AT_reference [DW_FORM_flag_present] (true)
27
28 ; CHECK: DW_TAG_subprogram
29 ; CHECK-NOT: DW_TAG_subprogram
30 ; CHECK: DW_AT_name {{.*}}"r"
31 ; CHECK-NOT: DW_TAG_subprogram
32 ; CHECK: DW_AT_rvalue_reference [DW_FORM_flag_present] (true)
33
34 %class.A = type { i8 }
35
36 ; Function Attrs: nounwind
37 define void @_Z1gv() #0 {
38 %a = alloca %class.A, align 1
39 %pl = alloca { i64, i64 }, align 8
40 %pr = alloca { i64, i64 }, align 8
41 call void @llvm.dbg.declare(metadata %class.A* %a, metadata !24, metadata !DIExpression()), !dbg !25
42 call void @llvm.dbg.declare(metadata { i64, i64 }* %pl, metadata !26, metadata !DIExpression()), !dbg !31
43 store { i64, i64 } { i64 ptrtoint (void (%class.A*)* @_ZNKR1A1lEv to i64), i64 0 }, { i64, i64 }* %pl, align 8, !dbg !31
44 call void @llvm.dbg.declare(metadata { i64, i64 }* %pr, metadata !32, metadata !DIExpression()), !dbg !35
45 store { i64, i64 } { i64 ptrtoint (void (%class.A*)* @_ZNKO1A1rEv to i64), i64 0 }, { i64, i64 }* %pr, align 8, !dbg !35
46 ret void, !dbg !36
47 }
48
49 ; Function Attrs: nounwind readnone
50 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
51
52 declare void @_ZNKR1A1lEv(%class.A*)
53
54 declare void @_ZNKO1A1rEv(%class.A*)
55
56 attributes #0 = { nounwind }
57 attributes #1 = { nounwind readnone }
58
59 !llvm.dbg.cu = !{!0}
60 !llvm.module.flags = !{!21, !22}
61 !llvm.ident = !{!23}
62
63 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !16, globals: !2, imports: !2)
64 !1 = !DIFile(filename: "debug-info-qualifiers.cpp", directory: "")
65 !2 = !{}
66 !3 = !{!4}
67 !4 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 2, size: 8, align: 8, file: !5, elements: !6, identifier: "_ZTS1A")
68 !5 = !DIFile(filename: "debug-info-qualifiers.cpp", directory: "")
69 !6 = !{!7, !13}
70 !7 = !DISubprogram(name: "l", linkageName: "_ZNKR1A1lEv", line: 5, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped | DIFlagLValueReference, isOptimized: false, scopeLine: 5, file: !5, scope: !"_ZTS1A", type: !8)
71 !8 = !DISubroutineType(flags: DIFlagLValueReference, types: !9)
72 !9 = !{null, !10}
73 !10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !11)
74 !11 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !"_ZTS1A")
75 !13 = !DISubprogram(name: "r", linkageName: "_ZNKO1A1rEv", line: 7, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagObjectPointer | DIFlagRValueReference, isOptimized: false, scopeLine: 7, file: !5, scope: !"_ZTS1A", type: !14)
76 !14 = !DISubroutineType(flags: DIFlagRValueReference, types: !9)
77 !16 = !{!17}
78 !17 = distinct !DISubprogram(name: "g", linkageName: "_Z1gv", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !5, scope: !18, type: !19, function: void ()* @_Z1gv, variables: !2)
79 !18 = !DIFile(filename: "debug-info-qualifiers.cpp", directory: "")
80 !19 = !DISubroutineType(types: !20)
81 !20 = !{null}
82 !21 = !{i32 2, !"Dwarf Version", i32 4}
83 !22 = !{i32 1, !"Debug Info Version", i32 3}
84 !23 = !{!"clang version 3.5 "}
85 !24 = !DILocalVariable(name: "a", line: 11, scope: !17, file: !18, type: !4)
86 !25 = !DILocation(line: 11, scope: !17)
87 !26 = !DILocalVariable(name: "pl", line: 16, scope: !17, file: !18, type: !27)
88 !27 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !28, extraData: !"_ZTS1A")
89 !28 = !DISubroutineType(flags: DIFlagLValueReference, types: !29)
90 !29 = !{null, !30}
91 !30 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A")
92 !31 = !DILocation(line: 16, scope: !17)
93 !32 = !DILocalVariable(name: "pr", line: 21, scope: !17, file: !18, type: !33)
94 !33 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !34, extraData: !"_ZTS1A")
95 !34 = !DISubroutineType(flags: DIFlagRValueReference, types: !29)
96 !35 = !DILocation(line: 21, scope: !17)
97 !36 = !DILocation(line: 22, scope: !17)
0 ; RUN: opt -analyze -module-debuginfo < %s | FileCheck %s
1
2
3 ; This module is generated from the following c-code:
4 ;
5 ; > union X;
6 ; >
7 ; > struct Y {
8 ; > union X *x;
9 ; > };
10 ; >
11 ; > struct Y y;
12
13
14 ; CHECK: Type: Y from /tmp/minimal.c:3 DW_TAG_structure_type
15 ; CHECK: Type: x from /tmp/minimal.c:4 DW_TAG_member
16 ; CHECK: Type: DW_TAG_pointer_type
17 ; CHECK: Type: X from /tmp/minimal.c:1 DW_TAG_structure_type
18
19
20 %struct.Y = type { %struct.X* }
21 %struct.X = type opaque
22
23 @y = common global %struct.Y zeroinitializer, align 8
24
25 !llvm.dbg.cu = !{!0}
26 !llvm.module.flags = !{!10, !11}
27 !llvm.ident = !{!12}
28
29 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (http://llvm.org/git/clang.git 247b30a043eb8f39ea3708e7e995089da0a6b00f) (http://llvm.org/git/llvm.git 6ecc7365a89c771fd229bdd9ffcc178684ea1aa5)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2)
30 !1 = !DIFile(filename: "minimal.c", directory: "/tmp")
31 !2 = !{}
32 !3 = !{!4}
33 !4 = !DIGlobalVariable(name: "y", scope: !0, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true, variable: %struct.Y* @y)
34 !5 = !DICompositeType(tag: DW_TAG_structure_type, name: "Y", file: !1, line: 3, size: 64, align: 64, elements: !6)
35 !6 = !{!7}
36 !7 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !5, file: !1, line: 4, baseType: !8, size: 64, align: 64)
37 !8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64)
38 !9 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", file: !1, line: 1, flags: DIFlagFwdDecl)
39 !10 = !{i32 2, !"Dwarf Version", i32 4}
40 !11 = !{i32 2, !"Debug Info Version", i32 3}
41 !12 = !{!"clang version 3.7.0 (http://llvm.org/git/clang.git 247b30a043eb8f39ea3708e7e995089da0a6b00f) (http://llvm.org/git/llvm.git 6ecc7365a89c771fd229bdd9ffcc178684ea1aa5)"}
0 ; RUN: opt -analyze -module-debuginfo < %s | FileCheck %s
1
2 ; Produced from linking:
3 ; /tmp/test1.c containing f()
4 ; /tmp/test2.c containing g()
5
6 ; Verify that both compile units and both their contained functions are
7 ; listed by DebugInfoFinder:
8 ;CHECK: Compile unit: DW_LANG_C99 from /tmp/test1.c
9 ;CHECK: Compile unit: DW_LANG_C99 from /tmp/test2.c
10 ;CHECK: Subprogram: f from /tmp/test1.c:1
11 ;CHECK: Subprogram: g from /tmp/test2.c:1
12
13 define void @f() {
14 ret void, !dbg !14
15 }
16
17 define void @g() {
18 ret void, !dbg !15
19 }
20
21 !llvm.dbg.cu = !{!0, !8}
22 !llvm.module.flags = !{!13, !16}
23
24 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (192092)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
25 !1 = !DIFile(filename: "test1.c", directory: "/tmp")
26 !2 = !{}
27 !3 = !{!4}
28 !4 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: void ()* @f, variables: !2)
29 !5 = !DIFile(filename: "test1.c", directory: "/tmp")
30 !6 = !DISubroutineType(types: !7)
31 !7 = !{null}
32 !8 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (192092)", isOptimized: false, emissionKind: 0, file: !9, enums: !2, retainedTypes: !2, subprograms: !10, globals: !2, imports: !2)
33 !9 = !DIFile(filename: "test2.c", directory: "/tmp")
34 !10 = !{!11}
35 !11 = distinct !DISubprogram(name: "g", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !9, scope: !12, type: !6, function: void ()* @g, variables: !2)
36 !12 = !DIFile(filename: "test2.c", directory: "/tmp")
37 !13 = !{i32 2, !"Dwarf Version", i32 4}
38 !14 = !DILocation(line: 1, scope: !4)
39 !15 = !DILocation(line: 1, scope: !11)
40 !16 = !{i32 1, !"Debug Info Version", i32 3}
0 ; REQUIRES: object-emission
1
2 ; RUN: %llc_dwarf -generate-dwarf-pub-sections=Enable -filetype=obj -o %t.o < %s
3 ; RUN: llvm-dwarfdump -debug-dump=pubnames %t.o | FileCheck %s
4 ; ModuleID = 'dwarf-public-names.cpp'
5 ;
6 ; Generated from:
7 ;
8 ; struct C {
9 ; void member_function();
10 ; static int static_member_function();
11 ; static int static_member_variable;
12 ; };
13 ;
14 ; int C::static_member_variable = 0;
15 ;
16 ; void C::member_function() {
17 ; static_member_variable = 0;
18 ; }
19 ;
20 ; int C::static_member_function() {
21 ; return static_member_variable;
22 ; }
23 ;
24 ; C global_variable;
25 ;
26 ; int global_function() {
27 ; return -1;
28 ; }
29 ;
30 ; namespace ns {
31 ; void global_namespace_function() {
32 ; global_variable.member_function();
33 ; }
34 ; int global_namespace_variable = 1;
35 ; }
36
37 ; Skip the output to the header of the pubnames section.
38 ; CHECK: debug_pubnames
39 ; CHECK: version = 0x0002
40
41 ; Check for each name in the output.
42 ; CHECK-DAG: "ns"
43 ; CHECK-DAG: "C::static_member_function"
44 ; CHECK-DAG: "global_variable"
45 ; CHECK-DAG: "ns::global_namespace_variable"
46 ; CHECK-DAG: "ns::global_namespace_function"
47 ; CHECK-DAG: "global_function"
48 ; CHECK-DAG: "C::static_member_variable"
49 ; CHECK-DAG: "C::member_function"
50
51 %struct.C = type { i8 }
52
53 @_ZN1C22static_member_variableE = global i32 0, align 4
54 @global_variable = global %struct.C zeroinitializer, align 1
55 @_ZN2ns25global_namespace_variableE = global i32 1, align 4
56
57 define void @_ZN1C15member_functionEv(%struct.C* %this) nounwind uwtable align 2 {
58 entry:
59 %this.addr = alloca %struct.C*, align 8
60 store %struct.C* %this, %struct.C** %this.addr, align 8
61 call void @llvm.dbg.declare(metadata %struct.C** %this.addr, metadata !28, metadata !DIExpression()), !dbg !30
62 %this1 = load %struct.C*, %struct.C** %this.addr
63 store i32 0, i32* @_ZN1C22static_member_variableE, align 4, !dbg !31
64 ret void, !dbg !32
65 }
66
67 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
68
69 define i32 @_ZN1C22static_member_functionEv() nounwind uwtable align 2 {
70 entry:
71 %0 = load i32, i32* @_ZN1C22static_member_variableE, align 4, !dbg !33
72 ret i32 %0, !dbg !33
73 }
74
75 define i32 @_Z15global_functionv() nounwind uwtable {
76 entry:
77 ret i32 -1, !dbg !34
78 }
79
80 define void @_ZN2ns25global_namespace_functionEv() nounwind uwtable {
81 entry:
82 call void @_ZN1C15member_functionEv(%struct.C* @global_variable), !dbg !35
83 ret void, !dbg !36
84 }
85
86 attributes #0 = { nounwind uwtable }
87 attributes #1 = { nounwind readnone }
88
89 !llvm.dbg.cu = !{!0}
90 !llvm.module.flags = !{!38}
91
92 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (http://llvm.org/git/clang.git a09cd8103a6a719cb2628cdf0c91682250a17bd2) (http://llvm.org/git/llvm.git 47d03cec0afca0c01ae42b82916d1d731716cd20)", isOptimized: false, emissionKind: 0, file: !37, enums: !1, retainedTypes: !1, subprograms: !2, globals: !24, imports: !1)
93 !1 = !{}
94 !2 = !{!3, !18, !19, !20}
95 !3 = distinct !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 9, file: !4, scope: null, type: !5, function: void (%struct.C*)* @_ZN1C15member_functionEv, declaration: !12, variables: !1)
96 !4 = !DIFile(filename: "dwarf-public-names.cpp", directory: "/usr2/kparzysz/s.hex/t")
97 !5 = !DISubroutineType(types: !6)
98 !6 = !{null, !7}
99 !7 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !8)
100 !8 = !DICompositeType(tag: DW_TAG_structure_type, name: "C", line: 1, size: 8, align: 8, file: !37, elements: !9)
101 !9 = !{!10, !12, !14}
102 !10 = !DIDerivedType(tag: DW_TAG_member, name: "static_member_variable", line: 4, flags: DIFlagStaticMember, file: !37, scope: !8, baseType: !11)
103 !11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
104 !12 = !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !4, scope: !8, type: !5, variables: !13)
105 !13 = !{} ; previously: invalid DW_TAG_base_type
106 !14 = !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !4, scope: !8, type: !15, variables: !17)
107 !15 = !DISubroutineType(types: !16)
108 !16 = !{!11}
109 !17 = !{} ; previously: invalid DW_TAG_base_type
110 !18 = distinct !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 13, file: !4, scope: null, type: !15, function: i32 ()* @_ZN1C22static_member_functionEv, declaration: !14, variables: !1)
111 !19 = distinct !DISubprogram(name: "global_function", linkageName: "_Z15global_functionv", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 19, file: !4, scope: !4, type: !15, function: i32 ()* @_Z15global_functionv, variables: !1)
112 !20 = distinct !DISubprogram(name: "global_namespace_function", linkageName: "_ZN2ns25global_namespace_functionEv", line: 24, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 24, file: !4, scope: !21, type: !22, function: void ()* @_ZN2ns25global_namespace_functionEv, variables: !1)
113 !21 = !DINamespace(name: "ns", line: 23, file: !4, scope: null)
114 !22 = !DISubroutineType(types: !23)
115 !23 = !{null}
116 !24 = !{!25, !26, !27}
117 !25 = !DIGlobalVariable(name: "static_member_variable", linkageName: "_ZN1C22static_member_variableE", line: 7, isLocal: false, isDefinition: true, scope: !8, file: !4, type: !11, variable: i32* @_ZN1C22static_member_variableE, declaration: !10)
118 !26 = !DIGlobalVariable(name: "global_variable", line: 17, isLocal: false, isDefinition: true, scope: null, file: !4, type: !8, variable: %struct.C* @global_variable)
119 !27 = !DIGlobalVariable(name: "global_namespace_variable", linkageName: "_ZN2ns25global_namespace_variableE", line: 27, isLocal: false, isDefinition: true, scope: !21, file: !4, type: !11, variable: i32* @_ZN2ns25global_namespace_variableE)
120 !28 = !DILocalVariable(name: "this", line: 9, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !3, file: !4, type: !29)
121 !29 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !8)
122 !30 = !DILocation(line: 9, scope: !3)
123 !31 = !DILocation(line: 10, scope: !3)
124 !32 = !DILocation(line: 11, scope: !3)
125 !33 = !DILocation(line: 14, scope: !18)
126 !34 = !DILocation(line: 20, scope: !19)
127 !35 = !DILocation(line: 25, scope: !20)
128 !36 = !DILocation(line: 26, scope: !20)
129 !37 = !DIFile(filename: "dwarf-public-names.cpp", directory: "/usr2/kparzysz/s.hex/t")
130 !38 = !{i32 1, !"Debug Info Version", i32 3}
0 ; REQUIRES: object-emission
1
2 ; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump - | FileCheck %s
3 ; RUN: %llc_dwarf -split-dwarf=Enable < %s -filetype=obj | llvm-dwarfdump - | FileCheck --check-prefix=FISSION %s
4
5 ; darwin has a workaround for a linker bug so it always emits one line table entry
6 ; XFAIL: darwin
7
8 ; Expect no line table entry since there are no functions and file references in this compile unit
9 ; CHECK: .debug_line contents:
10 ; CHECK: Line table prologue:
11 ; CHECK: total_length: 0x00000019
12 ; CHECK-NOT: file_names[
13
14 ; CHECK: .debug_pubnames contents:
15 ; CHECK-NOT: Offset
16
17 ; CHECK: .debug_pubtypes contents:
18 ; CHECK-NOT: Offset
19
20 ; Don't emit DW_AT_addr_base when there are no addresses.
21 ; FISSION-NOT: DW_AT_GNU_addr_base [DW_FORM_sec_offset]
22
23 !llvm.dbg.cu = !{!0}
24 !llvm.module.flags = !{!5}
25
26 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 143523)", isOptimized: true, emissionKind: 0, file: !4, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2)
27 !2 = !{}
28 !3 = !DIFile(filename: "empty.c", directory: "/home/nlewycky")
29 !4 = !DIFile(filename: "empty.c", directory: "/home/nlewycky")
30 !5 = !{i32 1, !"Debug Info Version", i32 3}
0 ; REQUIRES: object-emission
1 ;
2 ; RUN: %llc_dwarf -filetype=obj -O0 -dwarf-linkage-names=Enable < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
3
4 ; Make sure we can handle enums with the same identifier but in enum types of
5 ; different compile units.
6 ; rdar://17628609
7
8 ; CHECK: DW_TAG_compile_unit
9 ; CHECK: 0x[[ENUM:.*]]: DW_TAG_enumeration_type
10 ; CHECK-NEXT: DW_AT_name {{.*}} "EA"
11 ; CHECK: DW_TAG_subprogram
12 ; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_Z4topA2EA"
13 ; CHECK: DW_TAG_formal_parameter
14 ; CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x{{.*}} => {0x[[ENUM]]})
15
16 ; CHECK: DW_TAG_compile_unit
17 ; CHECK: DW_TAG_subprogram
18 ; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_Z4topB2EA"
19 ; CHECK: DW_TAG_formal_parameter
20 ; CHECK: DW_AT_type [DW_FORM_ref_addr] {{.*}}[[ENUM]]
21
22 ; Function Attrs: nounwind ssp uwtable
23 define void @_Z4topA2EA(i32 %sa) #0 {
24 entry:
25 %sa.addr = alloca i32, align 4
26 store i32 %sa, i32* %sa.addr, align 4
27 call void @llvm.dbg.declare(metadata i32* %sa.addr, metadata !22, metadata !DIExpression()), !dbg !23
28 ret void, !dbg !24
29 }
30
31 ; Function Attrs: nounwind readnone
32 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
33
34 ; Function Attrs: nounwind ssp uwtable
35 define void @_Z4topB2EA(i32 %sa) #0 {
36 entry:
37 %sa.addr = alloca i32, align 4
38 store i32 %sa, i32* %sa.addr, align 4
39 call void @llvm.dbg.declare(metadata i32* %sa.addr, metadata !25, metadata !DIExpression()), !dbg !26
40 ret void, !dbg !27
41 }
42
43 attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
44 attributes #1 = { nounwind readnone }
45
46 !llvm.dbg.cu = !{!0, !12}
47 !llvm.module.flags = !{!19, !20}
48 !llvm.ident = !{!21, !21}
49
50 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 214102:214133) (llvm/trunk 214102:214132)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !6, globals: !11, imports: !11)
51 !1 = !DIFile(filename: "a.cpp", directory: "")
52 !2 = !{!3}
53 !3 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "EA", line: 1, size: 32, align: 32, file: !1, elements: !4, identifier: "_ZTS2EA")
54 !4 = !{!5}
55 !5 = !DIEnumerator(name: "EA_0", value: 0) ; [ DW_TAG_enumerator ] [EA_0 :: 0]
56 !6 = !{!7}
57 !7 = distinct !DISubprogram(name: "topA", linkageName: "_Z4topA2EA", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !8, type: !9, function: void (i32)* @_Z4topA2EA, variables: !11)
58 !8 = !DIFile(filename: "a.cpp", directory: "")
59 !9 = !DISubroutineType(types: !10)
60 !10 = !{null, !"_ZTS2EA"}
61 !11 = !{}
62 !12 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 214102:214133) (llvm/trunk 214102:214132)", isOptimized: false, emissionKind: 1, file: !13, enums: !14, retainedTypes: !14, subprograms: !16, globals: !11, imports: !11)
63 !13 = !DIFile(filename: "b.cpp", directory: "")
64 !14 = !{!15}
65 !15 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "EA", line: 1, size: 32, align: 32, file: !13, elements: !4, identifier: "_ZTS2EA")
66 !16 = !{!17}
67 !17 = distinct !DISubprogram(name: "topB", linkageName: "_Z4topB2EA", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !13, scope: !18, type: !9, function: void (i32)* @_Z4topB2EA, variables: !11)
68 !18 = !DIFile(filename: "b.cpp", directory: "")
69 !19 = !{i32 2, !"Dwarf Version", i32 2}
70 !20 = !{i32 2, !"Debug Info Version", i32 3}
71 !21 = !{!"clang version 3.5.0 (trunk 214102:214133) (llvm/trunk 214102:214132)"}
72 !22 = !DILocalVariable(name: "sa", line: 5, arg: 1, scope: !7, file: !8, type: !"_ZTS2EA")
73 !23 = !DILocation(line: 5, column: 14, scope: !7)
74 !24 = !DILocation(line: 6, column: 1, scope: !7)
75 !25 = !DILocalVariable(name: "sa", line: 5, arg: 1, scope: !17, file: !18, type: !"_ZTS2EA")
76 !26 = !DILocation(line: 5, column: 14, scope: !17)
77 !27 = !DILocation(line: 6, column: 1, scope: !17)
0 ; REQUIRES: object-emission
1
2 ; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t
3 ; RUN: llvm-dwarfdump %t | FileCheck %s
4
5 ; IR generated from the following code compiled with clang -g:
6 ; enum e1 { I, J = 0xffffffffU, K = 0xf000000000000000ULL } a;
7 ; enum e2 { X };
8 ; void func() {
9 ; int b = X;
10 ; }
11
12 ; These values were previously being truncated to -1 and 0 respectively.
13
14 ; CHECK: debug_info contents
15 ; CHECK: DW_TAG_enumeration_type
16 ; CHECK-NEXT: DW_AT_name{{.*}} = "e1"
17 ; CHECK-NOT: NULL
18 ; CHECK: DW_TAG_enumerator
19 ; CHECK-NOT: NULL
20 ; CHECK: DW_TAG_enumerator
21 ; CHECK-NEXT: DW_AT_name{{.*}} = "J"
22 ; CHECK-NEXT: DW_AT_const_value [DW_FORM_sdata] (4294967295)
23 ; CHECK-NOT: NULL
24 ; CHECK: DW_TAG_enumerator
25 ; CHECK-NEXT: DW_AT_name{{.*}} = "K"
26 ; CHECK-NEXT: DW_AT_const_value [DW_FORM_sdata] (-1152921504606846976)
27
28 ; Check that we retain enums that aren't referenced by any variables, etc
29 ; CHECK: DW_TAG_enumeration_type
30 ; CHECK-NEXT: DW_AT_name{{.*}} = "e2"
31 ; CHECK-NOT: NULL
32 ; CHECK: DW_TAG_enumerator
33 ; CHECK-NEXT: DW_AT_name{{.*}} = "X"
34
35 @a = global i64 0, align 8
36
37 ; Function Attrs: nounwind uwtable
38 define void @_Z4funcv() #0 {
39 entry:
40 %b = alloca i32, align 4
41 call void @llvm.dbg.declare(metadata i32* %b, metadata !20, metadata !DIExpression()), !dbg !22
42 store i32 0, i32* %b, align 4, !dbg !22
43 ret void, !dbg !23
44 }
45
46 ; Function Attrs: nounwind readnone
47 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
48
49 attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
50 attributes #1 = { nounwind readnone }
51
52 !llvm.dbg.cu = !{!0}
53 !llvm.module.flags = !{!19, !24}
54
55 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !11, subprograms: !12, globals: !17, imports: !11)
56 !1 = !DIFile(filename: "enum.cpp", directory: "/tmp")
57 !2 = !{!3, !8}
58 !3 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "e1", line: 1, size: 64, align: 64, file: !1, elements: !4)
59 !4 = !{!5, !6, !7}
60 !5 = !DIEnumerator(name: "I", value: 0) ; [ DW_TAG_enumerator ] [I :: 0]
61 !6 = !DIEnumerator(name: "J", value: 4294967295) ; [ DW_TAG_enumerator ] [J :: 4294967295]
62 !7 = !DIEnumerator(name: "K", value: -1152921504606846976) ; [ DW_TAG_enumerator ] [K :: 17293822569102704640]
63 !8 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "e2", line: 2, size: 32, align: 32, file: !1, elements: !9)
64 !9 = !{!10}
65 !10 = !DIEnumerator(name: "X", value: 0) ; [ DW_TAG_enumerator ] [X :: 0]
66 !11 = !{}