[flang-commits] [clang] [flang] [llvm] [flang] Add -finit-local= to initialize automatic variables (PR #216164)

Tarun Prabhu via flang-commits flang-commits at lists.llvm.org
Tue Sep 22 05:51:18 PDT 2026


================
@@ -0,0 +1,20 @@
+! Tests that -finit-local= and -finit-local-zero are accepted by the Flang
+! driver and forwarded correctly to -fc1.
+
+! --- Valid values: zero, hex byte ---
+! RUN: %flang -### -S -finit-local=zero  %s 2>&1 | FileCheck --check-prefix=ZERO  %s
+! RUN: %flang -### -S -finit-local=0xAA  %s 2>&1 | FileCheck --check-prefix=HEX   %s
+! RUN: %flang -### -S -finit-local=0xff  %s 2>&1 | FileCheck --check-prefix=HEX2  %s
+
+! --- GFortran alias: -finit-local-zero ---
+! RUN: %flang -### -S -finit-local-zero  %s 2>&1 | FileCheck --check-prefix=ZERO %s
+! --- Invalid value should produce a diagnostic (fc1 level) ---
----------------
tarunprabhu wrote:

A newline here would visually separate the next class of checks.

```suggestion

! --- Invalid value should produce a diagnostic (fc1 level) ---
```

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


More information about the flang-commits mailing list