1 ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s 2 ; REQUIRES: object-emission 3 4 ; typedef struct __attribute__((aligned (128))) { 5 ; char c; 6 ; } S0; 7 ; 8 ; typedef struct { 9 ; __attribute__((aligned (64))) char c; 10 ; } S1; 11 ; 12 ; S0 s0; 13 ; 14 ; void f() { 15 ; S1 s1; 16 ; __attribute__((aligned (32))) int i; 17 ; } 18 19 ; CHECK: DW_TAG_typedef 20 ; CHECK-NOT: DW_TAG 21 ; CHECK: DW_AT_name{{.*}}"S0" 22 ; CHECK: DW_TAG_structure_type 23 ; CHECK-NOT: DW_TAG 24 ; CHECK: DW_AT_alignment{{.*}}128 25 26 ; CHECK: DW_TAG_variable 27 ; CHECK: DW_AT_name{{.*}}"i" 28 ; CHECK-NOT: DW_TAG 29 ; CHECK: DW_AT_alignment{{.*}}32 30 31 ; CHECK: DW_TAG_typedef 32 ; CHECK-NOT: DW_TAG 33 ; CHECK: DW_AT_name{{.*}}"S1" 34 ; CHECK: DW_TAG_structure_type 35 ; CHECK: DW_TAG_member 36 ; CHECK-NOT: DW_TAG 37 ; CHECK: DW_AT_name{{.*}}"c" 38 ; CHECK-NOT: DW_TAG 39 ; CHECK: DW_AT_alignment{{.*}}64 40 41 ; ModuleID = 'test.m' 42 source_filename = "test.m" 43 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 44 target triple = "x86_64-unknown-linux-gnu" 45 46 %struct.S0 = type { i8, [127 x i8] } 47 %struct.S1 = type { i8, [63 x i8] } 48 49 @s0 = common global %struct.S0 zeroinitializer, align 128, !dbg !0 50 51 ; Function Attrs: nounwind uwtable 52 define void @f() #0 !dbg !14 { 53 entry: 54 %s1 = alloca %struct.S1, align 64 55 %i = alloca i32, align 32 56 call void @llvm.dbg.declare(metadata %struct.S1* %s1, metadata !17, metadata !22), !dbg !23 57 call void @llvm.dbg.declare(metadata i32* %i, metadata !24, metadata !22), !dbg !26 58 ret void, !dbg !27 59 } 60 61 ; Function Attrs: nounwind readnone 62 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 63 64 attributes #0 = { nounwind uwtable } 65 attributes #1 = { nounwind readnone } 66 67 !llvm.dbg.cu = !{!2} 68 !llvm.module.flags = !{!11, !12} 69 !llvm.ident = !{!13} 70 71 !0 = distinct !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) 72 !1 = !DIGlobalVariable(name: "s0", scope: !2, file: !3, line: 10, type: !6, isLocal: false, isDefinition: true) 73 !2 = distinct !DICompileUnit(language: DW_LANG_ObjC, file: !3, producer: "clang version 4.0.0 (http://llvm.org/git/clang.git 9ce5220b821054019059c2ac4a9b132c7723832d) (http://llvm.org/git/llvm.git 9a6298be89ce0359b151c0a37af2776a12c69e85)", isOptimized: false, runtimeVersion: 1, emissionKind: FullDebug, enums: !4, globals: !5) 74 !3 = !DIFile(filename: "test.m", directory: "/tmp") 75 !4 = !{} 76 !5 = !{!0} 77 !6 = !DIDerivedType(tag: DW_TAG_typedef, name: "S0", file: !3, line: 3, baseType: !7) 78 !7 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !3, line: 1, size: 1024, align: 1024, elements: !8) 79 !8 = !{!9} 80 !9 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !7, file: !3, line: 2, baseType: !10, size: 8) 81 !10 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char) 82 !11 = !{i32 2, !"Dwarf Version", i32 4} 83 !12 = !{i32 2, !"Debug Info Version", i32 3} 84 !13 = !{!"clang version 4.0.0 (http://llvm.org/git/clang.git 9ce5220b821054019059c2ac4a9b132c7723832d) (http://llvm.org/git/llvm.git 9a6298be89ce0359b151c0a37af2776a12c69e85)"} 85 !14 = distinct !DISubprogram(name: "f", scope: !3, file: !3, line: 12, type: !15, isLocal: false, isDefinition: true, scopeLine: 12, isOptimized: false, unit: !2, retainedNodes: !4) 86 !15 = !DISubroutineType(types: !16) 87 !16 = !{null} 88 !17 = !DILocalVariable(name: "s1", scope: !14, file: !3, line: 13, type: !18) 89 !18 = !DIDerivedType(tag: DW_TAG_typedef, name: "S1", file: !3, line: 8, baseType: !19) 90 !19 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !3, line: 6, size: 512, elements: !20) 91 !20 = !{!21} 92 !21 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !19, file: !3, line: 7, baseType: !10, size: 8, align: 512) 93 !22 = !DIExpression() 94 !23 = !DILocation(line: 13, column: 6, scope: !14) 95 !24 = !DILocalVariable(name: "i", scope: !14, file: !3, line: 14, type: !25, align: 256) 96 !25 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) 97 !26 = !DILocation(line: 14, column: 37, scope: !14) 98 !27 = !DILocation(line: 15, column: 1, scope: !14) 99 100