llvm-project/clang/test/CodeGen/mangle-wasm-main-void.c
Sam Clegg 78747bd39a [clang][WebAssembly] Loosen restriction on main symbol mangling
Remove the `hasPrototype()` restriction so that old style K&R
declarations of main work too.

For example the following has 2 params but no prototype.

```
int main(argc, argv)
    int argc;
    char *argv[];
{
  return 0;
}
```

Also, use `getNumParams()` over `param_size()` which seems to be a more
direct way to get at the same information.

Also, add missing tests for this mangling.

Differential Revision: https://reviews.llvm.org/D127888
2022-06-15 13:56:05 -07:00

8 lines
206 B
C

// RUN: %clang_cc1 -emit-llvm %s -o - -triple=wasm32-unknown-unknown | FileCheck %s
int main(void) {
return 0;
}
// CHECK: @__main_void = hidden alias i32 (), ptr @main
// CHECK: define i32 @main() #0 {