================ @@ -0,0 +1,22 @@ +! Test -f[no-]backtrace driver forwarding to flang -fc1. +! An explicit -fbacktrace or -fno-backtrace is forwarded. The last flag wins. +! The default passes neither flag, and the frontend leaves the trace on. + +! RUN: %flang -### %s 2>&1 | FileCheck %s --check-prefixes=FC1,DEFAULT +! RUN: %flang -### -fno-backtrace %s 2>&1 | FileCheck %s --check-prefixes=FC1,NO-BACKTRACE +! RUN: %flang -### -fbacktrace -fno-backtrace %s 2>&1 | FileCheck %s --check-prefixes=FC1,NO-BACKTRACE +! RUN: %flang -### -fbacktrace %s 2>&1 | FileCheck %s --check-prefixes=FC1,BACKTRACE +! RUN: %flang -### -fno-backtrace -fbacktrace %s 2>&1 | FileCheck %s --check-prefixes=FC1,BACKTRACE + +! The frontend accepts both flags. +! RUN: %flang_fc1 -emit-hlfir -fbacktrace %s -o - +! RUN: %flang_fc1 -emit-hlfir -fno-backtrace %s -o - + +! FC1: "-fc1" +! BACKTRACE-SAME: "-fbacktrace" +! NO-BACKTRACE-SAME: "-fno-backtrace" +! BACKTRACE-NOT: "-fno-backtrace" ---------------- tarunprabhu wrote:
nit: I suggest swapping these lines so the labels are grouped consistently. Also, for consistency, you could consider adding a negative check in the `NO-BACKTRACE` case. ```suggestion ! BACKTRACE-SAME: "-fbacktrace" ! BACKTRACE-NOT: "-fno-backtrace" ! NO-BACKTRACE-SAME: "-fno-backtrace" ! NO-BACKTRACE-NOT: "-fbacktrace" ``` https://github.com/llvm/llvm-project/pull/241967 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
