1; RUN: llc -filetype=obj < %s -o %t.o
2; RUN: wasm-ld %t.o --no-entry --export=foo -o %t.wasm
3; RUN: llvm-dwarfdump -debug-line -debug-ranges %t.wasm | FileCheck %s
4
5; CHECK: Address
6; CHECK: 0x0000000000000005
7; CHECK-NEXT: 0x0000000000000006
8; CHECK-EMPTY:
9
10; CHECK: .debug_ranges contents:
11; CHECK: 00000000 {{[0-9]+}} {{[0-9]+}}
12; CHECK: 00000000 fffffffe fffffffe
13; CHECK: 00000000 <End of list>
14
15; ModuleID = 't.bc'
16target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
17target triple = "wasm32-unknown-unknown-wasm"
18
19; Function Attrs: noinline nounwind optnone
20define hidden i32 @foo() #0 !dbg !7 {
21entry:
22  ret i32 42, !dbg !11
23}
24
25; Function Attrs: noinline nounwind optnone
26define hidden i32 @bar() #0 !dbg !12 {
27entry:
28  ret i32 6, !dbg !13
29}
30
31attributes #0 = { noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
32
33!llvm.dbg.cu = !{!0}
34!llvm.module.flags = !{!3, !4, !5}
35!llvm.ident = !{!6}
36
37!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 7.0.0 (trunk 337293)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
38!1 = !DIFile(filename: "t.c", directory: "/d/y")
39!2 = !{}
40!3 = !{i32 2, !"Dwarf Version", i32 4}
41!4 = !{i32 2, !"Debug Info Version", i32 3}
42!5 = !{i32 1, !"wchar_size", i32 4}
43!6 = !{!"clang version 7.0.0 (trunk 337293)"}
44!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, retainedNodes: !2)
45!8 = !DISubroutineType(types: !9)
46!9 = !{!10}
47!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
48!11 = !DILocation(line: 2, column: 3, scope: !7)
49!12 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 5, type: !8, isLocal: false, isDefinition: true, scopeLine: 5, isOptimized: false, unit: !0, retainedNodes: !2)
50!13 = !DILocation(line: 6, column: 3, scope: !12)
51