
WebAssembly enforces a rule that caller and callee signatures must match. This means that the traditional technique of passing `main` `argc` and `argv` even when it doesn't need them doesn't work. Currently the backend renames `main` to `__original_main`, however this doesn't interact well with LTO'ing libc, and the name isn't intuitive. This patch allows us to transition to `__main_argc_argv` instead. This implements the proposal in https://github.com/WebAssembly/tool-conventions/pull/134 with a flag to disable it when targeting Emscripten, though this is expected to be temporary, as discussed in the proposal comments. Differential Revision: https://reviews.llvm.org/D70700
10 lines
178 B
C
10 lines
178 B
C
// RUN: %clang_cc1 -triple wasm32 -o - -emit-llvm %s | FileCheck %s
|
|
|
|
// Don't mangle the no-arg form of main.
|
|
|
|
int main(void) {
|
|
return 0;
|
|
}
|
|
|
|
// CHECK-LABEL: define i32 @main()
|