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