diff options
Diffstat (limited to 'llvm/test/DebugInfo/X86/lexical-block-inline.ll')
-rw-r--r-- | llvm/test/DebugInfo/X86/lexical-block-inline.ll | 198 |
1 files changed, 0 insertions, 198 deletions
diff --git a/llvm/test/DebugInfo/X86/lexical-block-inline.ll b/llvm/test/DebugInfo/X86/lexical-block-inline.ll deleted file mode 100644 index caf51bc3a50..00000000000 --- a/llvm/test/DebugInfo/X86/lexical-block-inline.ll +++ /dev/null @@ -1,198 +0,0 @@ -; RUN: llc -mtriple=x86_64-unknown-linux-gnu -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s -; RUN: llc -mtriple=x86_64-unknown-linux-gnu -split-dwarf=Enable -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=info.dwo - | FileCheck %s - -;; This test checks the following: -;; 1. Useless lexical block entry is not emitted. -;; 2. Function static variable, typedef, records (structure, class and union) -;; that are defined in lexical basic block are emitted as children to -;; these lexical blocks. -;; * For typedef and record check that both are emitted in lexical block -;; where they are declared and not in the one where they are used. -;; 3. "bar" function, which was inlined into "foo" function, is created as -;; abstract (with DW_AT_inline attribute). -;; All variables and types are defined in this abstract entry. -;; 4. "bar" function is created in "foo" function as inlined function -;; (with DW_TAG_inlined_subroutine attribute), and all its local variables -;; are created as concrete variables pointing to the abstract suitable entry -;; defined under abstract "bar" function. -;; 5. Lexical block entries created in the inline "bar" function entry have -;; "DW_AT_abstract_origin" attribute pointing to the equivalent abstract -;; lexical block entry. -;; -;; This test was generated by running following command: -;; clang -cc1 -O0 -g -emit-llvm foo.cpp -o - | opt -S -inline -sroa -;; Where foo.cpp -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;__inline int bar(int s) { -;; { -;; { -;; struct X { -;; int x; -;; }; -;; typedef int Y; -;; { -;; X a = { s }; -;; Y b(s); -;; static int c = 0; -;; return a.x + b + c++; -;; } -;; } -;; } -;;} -;; -;; -;;int foo(int i) { -;; return -;; bar(i); -;;} -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -; CHECK: [[Offset_bar:0x[0-9abcdef]+]]: DW_TAG_subprogram -; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: DW_AT_name {{.*}} "bar" -; CHECK: DW_AT_inline -; CHECK-NOT: NULL -; CHECK: DW_TAG_lexical_block - -; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: [[Offset_LB2:0x[0-9abcdef]+]]: DW_TAG_lexical_block - -; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: [[Offset_a:0x[0-9abcdef]+]]: DW_TAG_variable -; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: DW_AT_name {{.*}} "a" - -; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: [[Offset_b:0x[0-9abcdef]+]]: DW_TAG_variable -; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: DW_AT_name {{.*}} "b" - -; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: [[Offset_c:0x[0-9abcdef]+]]: DW_TAG_variable -; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: DW_AT_name {{.*}} "c" -; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: DW_AT_location - -; CHECK-NOT: {{DW_TAG}} -; CHECK: NULL - -; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: [[Offset_X:0x[0-9abcdef]+]]: DW_TAG_structure_type -; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: DW_AT_name {{.*}} "X" -; CHECK: NULL - -; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: [[Offset_Y:0x[0-9abcdef]+]]: DW_TAG_typedef -; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: DW_AT_name {{.*}} "Y" - -; CHECK-NOT: {{DW_TAG}} -; CHECK: NULL - - -; CHECK: DW_TAG_subprogram -; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: DW_AT_name {{.*}} "foo" -; CHECK-NOT: {{NULL}} -; CHECK: DW_TAG_inlined_subroutine -; CHECK-NEXT: DW_AT_abstract_origin {{.*}} {[[Offset_bar]]} - -; CHECK-NOT: {{NULL}} -; CHECK: DW_TAG_lexical_block - -; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: DW_TAG_lexical_block -; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: DW_AT_abstract_origin {{.*}} {[[Offset_LB2]]} - -; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: DW_TAG_variable -; CHECK-NEXT: DW_AT_location -; CHECK-NEXT: DW_AT_abstract_origin {{.*}} {[[Offset_a]]} - -; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: DW_TAG_variable -; CHECK-NEXT: DW_AT_location -; CHECK-NEXT: DW_AT_abstract_origin {{.*}} {[[Offset_b]]} - -; CHECK-NOT: {{DW_TAG}} -; CHECK: NULL - -; CHECK-NOT: {{DW_TAG}} -; CHECK: NULL - -%struct.X = type { i32 } - -$_ZZ3bariE1c = comdat any - -@_ZZ3bariE1c = linkonce_odr global i32 0, comdat, align 4 - -; Function Attrs: nounwind -define i32 @_Z3fooi(i32 %i) #0 !dbg !15 { -entry: - call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !22, metadata !23), !dbg !24 - call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !25, metadata !23), !dbg !26 - call void @llvm.dbg.declare(metadata %struct.X* undef, metadata !28, metadata !23), !dbg !29 - call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !28, metadata !23), !dbg !29 - call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !30, metadata !23), !dbg !31 - %add.i = add nsw i32 %i, %i, !dbg !32 - %0 = load i32, i32* @_ZZ3bariE1c, align 4, !dbg !32 - %inc.i = add nsw i32 %0, 1, !dbg !32 - store i32 %inc.i, i32* @_ZZ3bariE1c, align 4, !dbg !32 - %add2.i = add nsw i32 %add.i, %0, !dbg !32 - ret i32 %add2.i, !dbg !33 -} - -; Function Attrs: nounwind readnone -declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 - -; Function Attrs: nounwind readnone -declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1 - -attributes #0 = { nounwind "disable-tail-calls"="false" "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" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #1 = { nounwind readnone } - -!llvm.dbg.cu = !{!0, !34} -!llvm.module.flags = !{!19, !20} -!llvm.ident = !{!21} - -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 242994) (llvm/trunk 242995)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !14, globals: !16) -!1 = !DIFile(filename: "foo.cpp", directory: "/") -!2 = !{} -!3 = !{!4, !13} -!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", scope: !5, file: !1, line: 4, size: 32, align: 32, elements: !11, identifier: "_ZTSZ3bariE1X") -!5 = distinct !DILexicalBlock(scope: !6, file: !1, line: 3) -!6 = distinct !DILexicalBlock(scope: !7, file: !1, line: 2) -!7 = distinct !DISubprogram(name: "bar", linkageName: "_Z3bari", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, variables: !2) -!8 = !DISubroutineType(types: !9) -!9 = !{!10, !10} -!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!11 = !{!12} -!12 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !"_ZTSZ3bariE1X", file: !1, line: 5, baseType: !10, size: 32, align: 32) -!13 = !DIDerivedType(tag: DW_TAG_typedef, name: "Y", scope: !5, file: !1, line: 7, baseType: !10) -!14 = !{!15, !7} -!15 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi", scope: !1, file: !1, line: 19, type: !8, isLocal: false, isDefinition: true, scopeLine: 19, flags: DIFlagPrototyped, isOptimized: false, variables: !2) -!16 = !{!17} -!17 = !DIGlobalVariable(name: "c", scope: !18, file: !1, line: 11, type: !10, isLocal: false, isDefinition: true, variable: i32* @_ZZ3bariE1c) -!18 = distinct !DILexicalBlock(scope: !5, file: !1, line: 8) -!19 = !{i32 2, !"Dwarf Version", i32 4} -!20 = !{i32 2, !"Debug Info Version", i32 3} -!21 = !{!"clang version 3.8.0 (trunk 242994) (llvm/trunk 242995)"} -!22 = !DILocalVariable(name: "i", arg: 1, scope: !15, file: !1, line: 19, type: !10) -!23 = !DIExpression() -!24 = !DILocation(line: 19, scope: !15) -!25 = !DILocalVariable(name: "s", arg: 1, scope: !7, file: !1, line: 1, type: !10) -!26 = !DILocation(line: 1, scope: !7, inlinedAt: !27) -!27 = distinct !DILocation(line: 21, scope: !15) -!28 = !DILocalVariable(name: "a", scope: !18, file: !1, line: 9, type: !"_ZTSZ3bariE1X") -!29 = !DILocation(line: 9, scope: !18, inlinedAt: !27) -!30 = !DILocalVariable(name: "b", scope: !18, file: !1, line: 10, type: !13) -!31 = !DILocation(line: 10, scope: !18, inlinedAt: !27) -!32 = !DILocation(line: 12, scope: !18, inlinedAt: !27) -!33 = !DILocation(line: 20, scope: !15) - -; This line is manually added to check that the test does not crash when having -; more than one compile unit! -!34 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 242994) (llvm/trunk 242995)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2) |