pass-by-value.ll 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ; REQUIRES: object-emission
  2. ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
  3. ;
  4. ; // S is not trivially copyable.
  5. ; struct S {
  6. ; ~S() {}
  7. ; };
  8. ;
  9. ; // T is a POD.
  10. ; struct T {
  11. ; ~T() = default;
  12. ; };
  13. ;
  14. ; S s;
  15. ; T t;
  16. ;
  17. ; CHECK: DW_TAG_structure_type
  18. ; CHECK-NEXT: DW_AT_calling_convention (DW_CC_pass_by_reference)
  19. ; CHECK-NEXT: DW_AT_name ("S")
  20. ;
  21. ; CHECK: DW_TAG_structure_type
  22. ; CHECK-NEXT: DW_AT_calling_convention (DW_CC_pass_by_value)
  23. ; CHECK-NEXT: DW_AT_name ("T")
  24. %struct.S = type { i8 }
  25. %struct.T = type { i8 }
  26. @s = global %struct.S zeroinitializer, align 1, !dbg !0
  27. @__dso_handle = external hidden global i8
  28. @t = global %struct.T zeroinitializer, align 1, !dbg !6
  29. !llvm.dbg.cu = !{!2}
  30. !llvm.module.flags = !{!20, !21, !22, !23}
  31. !llvm.ident = !{!24}
  32. !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
  33. !1 = distinct !DIGlobalVariable(name: "s", scope: !2, file: !3, line: 9, type: !14, isLocal: false, isDefinition: true)
  34. !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 7.0.0 (trunk 321763) (llvm/trunk 321758)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
  35. !3 = !DIFile(filename: "pass.cpp", directory: "/")
  36. !4 = !{}
  37. !5 = !{!0, !6}
  38. !6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
  39. !7 = distinct !DIGlobalVariable(name: "t", scope: !2, file: !3, line: 10, type: !8, isLocal: false, isDefinition: true)
  40. !8 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "T", file: !3, line: 5, size: 8, elements: !9, identifier: "_ZTS1T", flags: DIFlagTypePassByValue)
  41. !9 = !{!10}
  42. !10 = !DISubprogram(name: "~T", scope: !8, file: !3, line: 6, type: !11, isLocal: false, isDefinition: false, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: false)
  43. !11 = !DISubroutineType(types: !12)
  44. !12 = !{null, !13}
  45. !13 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
  46. !14 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !3, line: 1, size: 8, elements: !15, identifier: "_ZTS1S", flags: DIFlagTypePassByReference)
  47. !15 = !{!16}
  48. !16 = !DISubprogram(name: "~S", scope: !14, file: !3, line: 2, type: !17, isLocal: false, isDefinition: false, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false)
  49. !17 = !DISubroutineType(types: !18)
  50. !18 = !{null, !19}
  51. !19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !14, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
  52. !20 = !{i32 2, !"Dwarf Version", i32 4}
  53. !21 = !{i32 2, !"Debug Info Version", i32 3}
  54. !22 = !{i32 1, !"wchar_size", i32 4}
  55. !23 = !{i32 7, !"PIC Level", i32 2}
  56. !24 = !{!"clang version 7.0.0 (trunk 321763) (llvm/trunk 321758)"}