[flang-commits] [flang] flang: allow EXIT to accept integer arguments of any kind (PR #174610)
Andre Kuhlenschmidt via flang-commits
flang-commits at lists.llvm.org
Tue Jan 13 15:17:59 PST 2026
================
@@ -3852,12 +3851,22 @@ void IntrinsicLibrary::genExit(llvm::ArrayRef<fir::ExtendedValue> args) {
EXIT_SUCCESS)
: fir::getBase(args[0]);
- assert(status.getType() == builder.getDefaultIntegerType() &&
- "STATUS parameter must be an INTEGER of default kind");
+ mlir::Type defaultIntTy = builder.getDefaultIntegerType();
+
+ // Warn about non-default integer kinds with -pedantic
+ if (status.getType() != defaultIntTy) {
+ mlir::emitWarning(
+ loc,
+ "EXIT intrinsic with non-default INTEGER kind is a language extension");
+ }
----------------
akuhlens wrote:
If this warning is going to exist it needs to happen as a part of semantics. I would just not include it, but you are welcome to add it somewhere in logical `intrinsics.cpp`.
https://github.com/llvm/llvm-project/pull/174610
More information about the flang-commits
mailing list