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
6 ; CHECK: 0x0000000000000003
7 ; CHECK-NEXT: 0x0000000000000006
10 ; CHECK: .debug_ranges contents:
11 ; CHECK: 00000000 {{[0-9]+}} {{[0-9]+}}
12 ; CHECK: 00000000 fffffffe fffffffe
13 ; CHECK: 00000000 <End of list>
16 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
17 target triple = "wasm32-unknown-unknown-wasm"
19 ; Function Attrs: noinline nounwind optnone
20 define hidden i32 @foo() #0 !dbg !7 {
25 ; Function Attrs: noinline nounwind optnone
26 define hidden i32 @bar() #0 !dbg !12 {
31 attributes #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" }
34 !llvm.module.flags = !{!3, !4, !5}
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")
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)
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)