inlined-strings.ll 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ; REQUIRES: object-emission
  2. ; RUN: %llc_dwarf -O0 -filetype=obj < %s -dwarf-inlined-strings=Enable -o - | llvm-dwarfdump -show-form - | FileCheck %s
  3. ; Also test that the null streamer doesn't crash with debug info.
  4. ; RUN: %llc_dwarf -O0 -filetype=null < %s -dwarf-inlined-strings=Enable
  5. ; generated from the following source compiled to bitcode with clang -g -O1
  6. ; static int i;
  7. ; int main() {
  8. ; (void)&i;
  9. ; }
  10. ; CHECK-NOT: DW_FORM_str{{(p|x)}}
  11. ; CHECK: DW_FORM_string
  12. ; CHECK-NOT: DW_FORM_str{{(p|x)}}
  13. source_filename = "test/DebugInfo/Generic/global.ll"
  14. ; Function Attrs: nounwind readnone uwtable
  15. define i32 @main() #0 !dbg !9 {
  16. entry:
  17. ret i32 0, !dbg !12
  18. }
  19. attributes #0 = { nounwind readnone uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
  20. !llvm.dbg.cu = !{!0}
  21. !llvm.module.flags = !{!7, !8}
  22. !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.4 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3, imports: !2)
  23. !1 = !DIFile(filename: "global.cpp", directory: "/tmp")
  24. !2 = !{}
  25. !3 = !{!4}
  26. !4 = !DIGlobalVariableExpression(var: !5, expr: !DIExpression())
  27. !5 = !DIGlobalVariable(name: "i", linkageName: "_ZL1i", scope: null, file: !1, line: 1, type: !6, isLocal: true, isDefinition: true)
  28. !6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
  29. !7 = !{i32 2, !"Dwarf Version", i32 3}
  30. !8 = !{i32 1, !"Debug Info Version", i32 3}
  31. !9 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !10, isLocal: false, isDefinition: true, scopeLine: 2, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !2)
  32. !10 = !DISubroutineType(types: !11)
  33. !11 = !{!6}
  34. !12 = !DILocation(line: 4, scope: !9)