[flang-commits] [flang] [clang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

Andrzej WarzyƄski via flang-commits flang-commits at lists.llvm.org
Thu Nov 23 12:35:06 PST 2023


================
@@ -0,0 +1,13 @@
+! RUN: %clang -x c -o %t.c-part -c %s.c-part
----------------
banach-space wrote:

That's a shame - thanks for checking. One alternative would be to add LLVM IR instead of a C file, but LLVM IR is not stable. Though a plain function definition should be fairly stable:
```
define i32 @main(i32 noundef %0, ptr noundef %1) {
  ret i32 0
}
```

Would this work? @kiranchandramohan - what do you think?

https://github.com/llvm/llvm-project/pull/73124


More information about the flang-commits mailing list