member-pointers.ll 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ; REQUIRES: object-emission
  2. ; XFAIL: hexagon
  3. ; RUN: %llc_dwarf -filetype=obj -O0 < %s > %t
  4. ; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s
  5. ; CHECK: DW_TAG_ptr_to_member_type
  6. ; CHECK: DW_TAG_ptr_to_member_type
  7. ; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE:0x[0-9a-f]+]]}
  8. ; CHECK: [[TYPE]]: DW_TAG_subroutine_type
  9. ; CHECK: DW_TAG_formal_parameter
  10. ; CHECK-NEXT: DW_AT_type
  11. ; CHECK-NEXT: DW_AT_artificial [DW_FORM_flag
  12. ; IR generated from clang -g with the following source:
  13. ; struct S {
  14. ; };
  15. ;
  16. ; int S::*x = 0;
  17. ; void (S::*y)(int) = 0;
  18. 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
  21. !llvm.dbg.cu = !{!13}
  22. !llvm.module.flags = !{!15}
  23. !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
  24. !1 = !DIGlobalVariable(name: "x", scope: null, file: !2, line: 4, type: !3, isLocal: false, isDefinition: true)
  25. !2 = !DIFile(filename: "simple.cpp", directory: "/home/blaikie/Development/scratch")
  26. !3 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !4, extraData: !5)
  27. !4 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
  28. !5 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !2, line: 1, size: 8, align: 8, elements: !6)
  29. !6 = !{}
  30. !7 = !DIGlobalVariableExpression(var: !8, expr: !DIExpression())
  31. !8 = !DIGlobalVariable(name: "y", scope: null, file: !2, line: 5, type: !9, isLocal: false, isDefinition: true)
  32. !9 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !10, extraData: !5)
  33. !10 = !DISubroutineType(types: !11)
  34. !11 = !{null, !12, !4}
  35. !12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
  36. !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)
  37. !14 = !{!0, !7}
  38. !15 = !{i32 1, !"Debug Info Version", i32 3}