Peter Collingbourne | b736065 | 2015-03-25 17:44:49 +0000 | [diff] [blame^] | 1 | ; REQUIRES: object-emission |
| 2 | |
| 3 | ; RUN: llc -mtriple=x86_64-linux-gnu -filetype=obj %s -o - | llvm-dwarfdump -debug-dump=all - > %t |
| 4 | ; RUN: FileCheck --check-prefix=CHECK1 %s < %t |
| 5 | ; RUN: FileCheck --check-prefix=CHECK2 %s < %t |
| 6 | ; RUN: FileCheck --check-prefix=CHECK3 %s < %t |
| 7 | |
| 8 | ; Test that we accept and generate DWARF entities for DW_TAG_structure_type, |
| 9 | ; DW_TAG_member and DW_TAG_typedef with no source location. These can come up |
| 10 | ; in some languages with predefined types. |
| 11 | |
| 12 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" |
| 13 | target triple = "x86_64-unknown-linux-gnu" |
| 14 | |
| 15 | %struct.S = type { %struct.S* } |
| 16 | |
| 17 | define void @f() { |
| 18 | %x = alloca %struct.S, align 8 |
| 19 | ; CHECK1: DW_TAG_structure_type |
| 20 | ; CHECK1-NOT: DW_AT_decl_file |
| 21 | ; CHECK1-NOT: DW_AT_decl_line |
| 22 | ; CHECK1: {{DW_TAG|NULL}} |
| 23 | |
| 24 | ; CHECK2: DW_TAG_member |
| 25 | ; CHECK2-NOT: DW_AT_decl_file |
| 26 | ; CHECK2-NOT: DW_AT_decl_line |
| 27 | ; CHECK2: {{DW_TAG|NULL}} |
| 28 | |
| 29 | ; CHECK3: DW_TAG_typedef |
| 30 | ; CHECK3-NOT: DW_AT_decl_file |
| 31 | ; CHECK3-NOT: DW_AT_decl_line |
| 32 | ; CHECK3: {{DW_TAG|NULL}} |
| 33 | call void @llvm.dbg.declare(metadata %struct.S* %x, metadata !10, metadata !16), !dbg !17 |
| 34 | ret void, !dbg !18 |
| 35 | } |
| 36 | |
| 37 | declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 |
| 38 | |
| 39 | !llvm.dbg.cu = !{!0} |
| 40 | !llvm.module.flags = !{!7, !8} |
| 41 | !llvm.ident = !{!9} |
| 42 | |
| 43 | !0 = !MDCompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) |
| 44 | !1 = !MDFile(filename: "file.c", directory: "/dir") |
| 45 | !2 = !{} |
| 46 | !3 = !{!4} |
| 47 | !4 = !MDSubprogram(name: "f", scope: !1, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true, scopeLine: 7, isOptimized: false, function: void ()* @f, variables: !2) |
| 48 | !5 = !MDSubroutineType(types: !6) |
| 49 | !6 = !{null} |
| 50 | !7 = !{i32 2, !"Dwarf Version", i32 4} |
| 51 | !8 = !{i32 2, !"Debug Info Version", i32 3} |
| 52 | !9 = !{!"clang"} |
| 53 | !10 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "x", scope: !4, file: !1, line: 8, type: !11) |
| 54 | !11 = !MDDerivedType(tag: DW_TAG_typedef, name: "SS", baseType: !12) |
| 55 | !12 = !MDCompositeType(tag: DW_TAG_structure_type, name: "S", size: 64, align: 64, elements: !13) |
| 56 | !13 = !{!14} |
| 57 | !14 = !MDDerivedType(tag: DW_TAG_member, name: "s", scope: !12, baseType: !15, size: 64, align: 64) |
| 58 | !15 = !MDDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64, align: 64) |
| 59 | !16 = !MDExpression() |
| 60 | !17 = !MDLocation(line: 8, column: 6, scope: !4) |
| 61 | !18 = !MDLocation(line: 9, column: 1, scope: !4) |