compiler: test traps report correct line numbers (#1528)

Signed-off-by: Nuno Cruces <ncruces@users.noreply.github.com>
This commit is contained in:
Nuno Cruces
2023-06-19 23:04:02 +01:00
committed by GitHub
parent c43a169a25
commit c8ee0baaf8
5 changed files with 29 additions and 1 deletions

View File

@@ -19,6 +19,9 @@ var TinyGoWasm []byte
//go:embed testdata/zig/main.wasm
var ZigWasm []byte
//go:embed testdata/zig-cc/main.wasm
var ZigCCWasm []byte
// RustWasm comes with huge DWARF sections, so we do not check it in directly,
// but instead xz-compressed one is.
var RustWasm []byte

View File

@@ -0,0 +1,13 @@
volatile int base = 65536;
void a() {
char str[16];
str[4] = 'a';
str[8] = 'b';
str[12 + base] = 'c'; // This traps.
}
int main() {
a();
return 0;
}

Binary file not shown.