Path: blob/main/crates/test-programs/src/bin/dwarf_codegen_optimized.cc
3069 views
// clang-format off1// clang -o codegen-optimized.wasm -target wasm32-unknown-wasip1 -g codegen-optimized.cpp2// clang-format on34// Make sure to adjust the break locations in lldb.rs when modifying the test.5#define BREAKPOINT67int InvalidateRegisters() {8int r1 = -1;9int r2 = -2;10int r3 = -3;11int r4 = -4;12int r5 = -5;13int r6 = -6;14int r7 = -7;15int r8 = -8;16return r1 + r2 + r3 + r4 + r5 + r6 + r7 + r8;17}1819void VariableWithSimpleLifetime() {20// Here we are testing that the value range of "x" is correctly recorded21// as being bound by a loclist that is shorted than the entire method body,22// even as the location can be represented with a single DWARF expression.23int x = 42;24InvalidateRegisters();25BREAKPOINT;26}2728void InitializeTest() {}2930int main(int argc, char *argv[]) {31InitializeTest();32VariableWithSimpleLifetime();33return 0;34}353637