blob: a64caed5f6fe5ac594a6dd814c2241174c8896f5 [file] [log] [blame]
Michael Gottesmane5904412013-08-23 00:23:28 +00001; RUN: opt -strip-debug < %s -S | FileCheck %s
2
3; CHECK-NOT: llvm.dbg
Devang Pateldb735cb2010-06-30 21:29:00 +00004
5@x = common global i32 0 ; <i32*> [#uses=0]
6
7define void @foo() nounwind readnone optsize ssp {
8entry:
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +00009 tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !5, metadata !{}), !dbg !10
Devang Pateldb735cb2010-06-30 21:29:00 +000010 ret void, !dbg !11
11}
12
Adrian Prantl87b7eb92014-10-01 18:55:02 +000013declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
Devang Pateldb735cb2010-06-30 21:29:00 +000014
Manman Ren921382e2013-07-27 01:26:08 +000015!llvm.dbg.cu = !{!2}
Manman Ren409558f2013-11-22 21:49:45 +000016!llvm.module.flags = !{!13}
Devang Pateldb735cb2010-06-30 21:29:00 +000017!llvm.dbg.sp = !{!0}
18!llvm.dbg.lv.foo = !{!5}
19!llvm.dbg.gv = !{!8}
20
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000021!0 = !DISubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !12, scope: !1, type: !3, function: void ()* @foo)
22!1 = !DIFile(filename: "b.c", directory: "/tmp")
23!2 = !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !12, enums: !4, retainedTypes: !4)
24!3 = !DISubroutineType(types: !4)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000025!4 = !{null}
Duncan P. N. Exon Smithed013cd2015-07-31 18:58:39 +000026!5 = !DILocalVariable(name: "y", line: 3, scope: !6, file: !1, type: !7)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000027!6 = distinct !DILexicalBlock(line: 2, column: 0, file: !12, scope: !0)
28!7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
29!8 = !DIGlobalVariable(name: "x", line: 1, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !7, variable: i32* @x)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000030!9 = !{i32 0}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000031!10 = !DILocation(line: 3, scope: !6)
32!11 = !DILocation(line: 4, scope: !6)
33!12 = !DIFile(filename: "b.c", directory: "/tmp")
Duncan P. N. Exon Smithe2741802015-03-03 17:24:31 +000034!13 = !{i32 1, !"Debug Info Version", i32 3}