| Issue |
115186
|
| Summary |
Miscompiled program with `--target=wasm32`
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
tekhnus
|
Here is a simple C++ program:
```
struct BigClass {
char data[400000];
};
struct Class {
char big_data[400000];
int value{33};
};
Class glob{};
extern "C" int _start() {
glob.value = 42;
BigClass s1{};
return glob.value;
}
```
When compiled and ran with `wasmer` runtime, it outputs "0" instead of expected "42":
```
+ clang-17 --version
clang version 17.0.6
Target: aarch64-apple-darwin23.6.0
Thread model: posix
InstalledDir: /nix/store/glzjy0xq2xhmwg6pc8c1pdk7gln127wj-clang-17.0.6/bin
+ clang-17 -std=c++20 -pedantic -Wall -Wno-unused-variable --target=wasm32 --no-standard-libraries -mbulk-memory -O0 -o main.wasm main.cpp
+ wasmer main.wasm
0
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs