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

Michael Klemm via flang-commits flang-commits at lists.llvm.org
Fri Nov 24 09:26:44 PST 2023


================
@@ -0,0 +1,15 @@
+! UNSUPPORTED: system-windows
+
+! RUN: %flang -x ir -o %t.c-object -c %S/Inputs/main_dupes.ll
+! RUN: %flang -o %t -c %s
+! RUN: not %flang -o %t.exe %t %t.c-object 2>&1
----------------
mjklemm wrote:

I'd actually prefer to have a separate test for this, as a working test is any other test that actually produces an executable.

If you insist :-), then I'd even go and change the test from testing for a duplicate of main to a general link time test that tests both a successful link and the failing one that I'm after.

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


More information about the flang-commits mailing list