[flang-commits] [clang] [flang] [flang][driver] Support -gdwarf-N option. (PR #158314)
Tarun Prabhu via flang-commits
flang-commits at lists.llvm.org
Mon Sep 15 07:09:50 PDT 2025
================
@@ -0,0 +1,27 @@
+// RUN: %flang -### -S %s -g -gdwarf-5 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF5 %s
+// RUN: %flang -### -S %s -g1 -gdwarf-5 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-WITH-G1-DWARF5 %s
+// RUN: %flang -### -S %s -gdwarf-5 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-WITHOUT-G-DWARF5 %s
----------------
tarunprabhu wrote:
Perhaps both `CHECK-WITH-G-DWARF5` and `CHECK-WITHOUT-G-DWARF5` could be replaced with a single `CHECK-DWARF5`. By swapping the tests, it becomes more obvious that in one case, `-g` is provided, while in the other, it is not. Since the check prefix now has the same name, it is clear that the expected behavior is the same.
For instance:
```suggestion
// RUN: %flang -### -S %s -g -gdwarf-5 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-DWARF5 %s
// RUN: %flang -### -S %s -gdwarf-5 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-DWARF5 %s
// RUN: %flang -### -S %s -g1 -gdwarf-5 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WITH-G1-DWARF5 %s
```
https://github.com/llvm/llvm-project/pull/158314
More information about the flang-commits
mailing list