1; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s 2; REQUIRES: object-emission 3 4; Generated by clang++ -c -g -std=c++11 -S -emit-llvm from the following C++11 source 5; struct S { 6; char x; 7; alignas(128) char xx; 8; }; 9; 10; class alignas(64) C0 { 11; }; 12; 13; class C1 { 14; alignas(64) static void *p; 15; }; 16; 17; enum alignas(16) E { 18; A, 19; B, 20; C, 21; }; 22; 23; C0 c0; 24; 25; alignas(2048) S s; 26; 27; void foo() 28; { 29; S ss; 30; E e; 31; C1 c1; 32; alignas(32) int i = 42; 33; auto Lambda = [i](){}; 34; } 35 36; CHECK: DW_TAG_class_type 37; CHECK-NOT: DW_TAG 38; CHECK: DW_AT_name{{.*}}"C0" 39; CHECK-NOT: DW_TAG 40; CHECK: DW_AT_alignment{{.*}}64 41 42; CHECK: DW_TAG_variable 43; CHECK-NOT: DW_TAG 44; CHECK: DW_AT_name{{.*}}"s" 45; CHECK-NOT: DW_TAG 46; CHECK: DW_AT_alignment{{.*}}2048 47 48; CHECK: DW_TAG_structure_type 49; CHECK: DW_TAG_member 50; CHECK: DW_AT_name{{.*}}"xx" 51; CHECK-NOT: DW_TAG 52; CHECK: DW_AT_alignment{{.*}}128 53 54; CHECK: DW_TAG_enumeration_type 55; CHECK-NOT: DW_TAG 56; CHECK: DW_AT_alignment{{.*}}16 57 58; CHECK: DW_TAG_variable 59; CHECK: DW_AT_name{{.*}}"i" 60; CHECK-NOT: DW_TAG 61; CHECK: DW_AT_alignment{{.*}}32 62; CHECK: DW_TAG_class_type 63; CHECK: DW_TAG_member 64; CHECK-NOT: DW_TAG 65; CHECK: DW_AT_name{{.*}}"i" 66; CHECK-NOT: DW_TAG 67; CHECK: DW_AT_alignment{{.*}}32 68 69; CHECK: DW_TAG_class_type 70; CHECK-NOT: DW_TAG 71; CHECK: DW_AT_name{{.*}}"C1" 72; CHECK: DW_TAG_member 73; CHECK-NOT: DW_TAG 74; CHECK: DW_AT_name{{.*}}"p" 75; CHECK-NOT: DW_TAG 76; CHECK: DW_AT_alignment{{.*}}64 77 78; ModuleID = 'test.cpp' 79source_filename = "test.cpp" 80target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 81target triple = "x86_64-unknown-linux-gnu" 82 83%class.C0 = type { [64 x i8] } 84%struct.S = type { i8, [127 x i8], i8, [127 x i8] } 85%class.C1 = type { i8 } 86%class.anon = type { i32 } 87 88@c0 = global %class.C0 zeroinitializer, align 64, !dbg !0 89@s = global %struct.S zeroinitializer, align 2048, !dbg !11 90 91; Function Attrs: nounwind uwtable 92define void @_Z3foov() #0 !dbg !22 { 93entry: 94 %ss = alloca %struct.S, align 128 95 %e = alloca i32, align 16 96 %c1 = alloca %class.C1, align 1 97 %i = alloca i32, align 32 98 %Lambda = alloca %class.anon, align 4 99 call void @llvm.dbg.declare(metadata %struct.S* %ss, metadata !25, metadata !26), !dbg !27 100 call void @llvm.dbg.declare(metadata i32* %e, metadata !28, metadata !26), !dbg !29 101 call void @llvm.dbg.declare(metadata %class.C1* %c1, metadata !30, metadata !26), !dbg !35 102 call void @llvm.dbg.declare(metadata i32* %i, metadata !36, metadata !26), !dbg !38 103 store i32 42, i32* %i, align 32, !dbg !38 104 call void @llvm.dbg.declare(metadata %class.anon* %Lambda, metadata !39, metadata !26), !dbg !48 105 %0 = getelementptr inbounds %class.anon, %class.anon* %Lambda, i32 0, i32 0, !dbg !49 106 %1 = load i32, i32* %i, align 32, !dbg !50 107 store i32 %1, i32* %0, align 4, !dbg !49 108 ret void, !dbg !51 109} 110 111; Function Attrs: nounwind readnone 112declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 113 114attributes #0 = { nounwind uwtable } 115attributes #1 = { nounwind readnone } 116 117!llvm.dbg.cu = !{!1} 118!llvm.module.flags = !{!19, !20} 119!llvm.ident = !{!21} 120 121!0 = distinct !DIGlobalVariable(name: "c0", scope: !1, file: !5, line: 19, type: !17, isLocal: false, isDefinition: true) 122!1 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 4.0.0 (http://llvm.org/git/clang.git 9ce5220b821054019059c2ac4a9b132c7723832d) (http://llvm.org/git/llvm.git 9a6298be89ce0359b151c0a37af2776a12c69e85)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !3, globals: !10) 123!2 = !DIFile(filename: "test.cpp", directory: "/tmp") 124!3 = !{!4} 125!4 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "E", file: !5, line: 13, size: 32, align: 128, elements: !6, identifier: "_ZTS1E") 126!5 = !DIFile(filename: "./test.cpp", directory: "/tmp") 127!6 = !{!7, !8, !9} 128!7 = !DIEnumerator(name: "A", value: 0) 129!8 = !DIEnumerator(name: "B", value: 1) 130!9 = !DIEnumerator(name: "C", value: 2) 131!10 = !{!0, !11} 132!11 = distinct !DIGlobalVariable(name: "s", scope: !1, file: !5, line: 21, type: !12, isLocal: false, isDefinition: true, align: 16384) 133!12 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !5, line: 1, size: 2048, elements: !13, identifier: "_ZTS1S") 134!13 = !{!14, !16} 135!14 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !12, file: !5, line: 2, baseType: !15, size: 8) 136!15 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char) 137!16 = !DIDerivedType(tag: DW_TAG_member, name: "xx", scope: !12, file: !5, line: 3, baseType: !15, size: 8, align: 1024, offset: 1024) 138!17 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "C0", file: !5, line: 6, size: 512, align: 512, elements: !18, identifier: "_ZTS2C0") 139!18 = !{} 140!19 = !{i32 2, !"Dwarf Version", i32 4} 141!20 = !{i32 2, !"Debug Info Version", i32 3} 142!21 = !{!"clang version 4.0.0 (http://llvm.org/git/clang.git 9ce5220b821054019059c2ac4a9b132c7723832d) (http://llvm.org/git/llvm.git 9a6298be89ce0359b151c0a37af2776a12c69e85)"} 143!22 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !5, file: !5, line: 23, type: !23, isLocal: false, isDefinition: true, scopeLine: 24, flags: DIFlagPrototyped, isOptimized: false, unit: !1, variables: !18) 144!23 = !DISubroutineType(types: !24) 145!24 = !{null} 146!25 = !DILocalVariable(name: "ss", scope: !22, file: !5, line: 25, type: !12) 147!26 = !DIExpression() 148!27 = !DILocation(line: 25, column: 7, scope: !22) 149!28 = !DILocalVariable(name: "e", scope: !22, file: !5, line: 26, type: !4) 150!29 = !DILocation(line: 26, column: 7, scope: !22) 151!30 = !DILocalVariable(name: "c1", scope: !22, file: !5, line: 27, type: !31) 152!31 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "C1", file: !5, line: 9, size: 8, elements: !32, identifier: "_ZTS2C1") 153!32 = !{!33} 154!33 = !DIDerivedType(tag: DW_TAG_member, name: "p", scope: !31, file: !5, line: 10, baseType: !34, align: 512, flags: DIFlagStaticMember) 155!34 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) 156!35 = !DILocation(line: 27, column: 8, scope: !22) 157!36 = !DILocalVariable(name: "i", scope: !22, file: !5, line: 28, type: !37, align: 256) 158!37 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) 159!38 = !DILocation(line: 28, column: 21, scope: !22) 160!39 = !DILocalVariable(name: "Lambda", scope: !22, file: !5, line: 29, type: !40) 161!40 = distinct !DICompositeType(tag: DW_TAG_class_type, scope: !22, file: !5, line: 29, size: 32, elements: !41) 162!41 = !{!42, !43} 163!42 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !40, file: !5, line: 29, baseType: !37, size: 32, align: 256) 164!43 = !DISubprogram(name: "operator()", scope: !40, file: !5, line: 29, type: !44, isLocal: false, isDefinition: false, scopeLine: 29, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false) 165!44 = !DISubroutineType(types: !45) 166!45 = !{null, !46} 167!46 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !47, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer) 168!47 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !40) 169!48 = !DILocation(line: 29, column: 10, scope: !22) 170!49 = !DILocation(line: 29, column: 19, scope: !22) 171!50 = !DILocation(line: 29, column: 20, scope: !22) 172!51 = !DILocation(line: 30, column: 1, scope: !22) 173