Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/crates/test-programs/src/bin/dwarf_fib_wasm_dwarf5.c
3067 views
1
//! flags = ['-gdwarf-5', '-Wl,--no-entry,--export=fib']
2
3
int fib(int n) {
4
int t, a = 0, b = 1;
5
for (int i = 0; i < n; i++) {
6
t = a;
7
a = b;
8
b += t;
9
}
10
return b;
11
}
12
13
// Placed at the end so that line numbers are stable.
14
//
15
// clang --target=wasm32 fib-wasm.c -o fib-wasm-split4.wasm \
16
// -gdwarf-4 -gsplit-dwarf \
17
// -Wl,--no-entry,--export=fib -nostdlib -fdebug-prefix-map=$PWD=.
18
// llvm-dwp -e fib-wasm-split4.wasm -o fib-wasm-split4.dwp
19
20