[clang] [flang] [flang][debug] Add compressed DWARF support in Flang (PR #212584)

Tarun Prabhu via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 30 08:12:17 PDT 2026


================
@@ -0,0 +1,20 @@
+! Test -gz (compressed debug sections) option handling.
+
+! REQUIRES: zlib
+
+! RUN: %flang -### -c -target x86_64-unknown-linux-gnu -gz %s 2>&1 | FileCheck %s --check-prefix=GZ
+! RUN: %flang -### -c -target x86_64-unknown-linux-gnu -gz=zlib %s 2>&1 | FileCheck %s --check-prefix=GZ
+! GZ: "--compress-debug-sections=zlib"
+
+! RUN: %flang -### -c -target x86_64-unknown-linux-gnu -gz=none %s 2>&1 | FileCheck %s --check-prefix=GZ-NONE
+! GZ-NONE: "--compress-debug-sections=none"
+
+! RUN: not %flang -### -c -target x86_64-unknown-linux-gnu -gz=invalid %s 2>&1 | FileCheck %s --check-prefix=GZ-INVALID
+! GZ-INVALID: error: unsupported argument 'invalid' to option '-gz='
+
+! Test that -gz without -g still passes --compress-debug-sections to fc1.
+! RUN: %flang -### -c -target x86_64-unknown-linux-gnu -gz=zlib %s 2>&1 | FileCheck %s --check-prefix=GZ-NO-G
----------------
tarunprabhu wrote:

Is this test the same as the one on line 5?

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


More information about the cfe-commits mailing list