Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / DebugInfo / Generic / member-pointers.ll
blob278065b37370768e02aa1d98142abfd1e789bda6
1 ; RUN: %llc_dwarf -filetype=obj -O0 < %s > %t
2 ; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s
3 ; CHECK: DW_TAG_ptr_to_member_type
4 ; CHECK: DW_TAG_ptr_to_member_type
5 ; CHECK-NEXT: DW_AT_type [DW_FORM_ref4]       (cu + {{.*}} => {[[TYPE:0x[0-9a-f]+]]}
6 ; CHECK: [[TYPE]]:   DW_TAG_subroutine_type
7 ; CHECK: DW_TAG_formal_parameter
8 ; CHECK-NEXT: DW_AT_type
9 ; CHECK-NEXT: DW_AT_artificial [DW_FORM_flag
10 ; IR generated from clang -g with the following source:
11 ; struct S {
12 ; };
14 ; int S::*x = 0;
15 ; void (S::*y)(int) = 0;
17 source_filename = "test/DebugInfo/Generic/member-pointers.ll"
19 @x = global i64 -1, align 8, !dbg !0
20 @y = global { i64, i64 } zeroinitializer, align 8, !dbg !7
22 !llvm.dbg.cu = !{!13}
23 !llvm.module.flags = !{!15}
25 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
26 !1 = !DIGlobalVariable(name: "x", scope: null, file: !2, line: 4, type: !3, isLocal: false, isDefinition: true)
27 !2 = !DIFile(filename: "simple.cpp", directory: "/home/blaikie/Development/scratch")
28 !3 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !4, extraData: !5)
29 !4 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
30 !5 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !2, line: 1, size: 8, align: 8, elements: !6)
31 !6 = !{}
32 !7 = !DIGlobalVariableExpression(var: !8, expr: !DIExpression())
33 !8 = !DIGlobalVariable(name: "y", scope: null, file: !2, line: 5, type: !9, isLocal: false, isDefinition: true)
34 !9 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !10, extraData: !5)
35 !10 = !DISubroutineType(types: !11)
36 !11 = !{null, !12, !4}
37 !12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
38 !13 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.3 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !6, retainedTypes: !6, globals: !14, imports: !6)
39 !14 = !{!0, !7}
40 !15 = !{i32 1, !"Debug Info Version", i32 3}