[clang] [clang] Use a specific target when testing that `-fomit-frame-pointer` and `-pg` are mutually exclusive (PR #148000)
Daniel Paoliello via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 10 09:57:53 PDT 2025
https://github.com/dpaoliello created https://github.com/llvm/llvm-project/pull/148000
Some targets, such as `aarch64-pc-windows-msvc`, always require that Frame Pointer be reserved even when `-fomit-frame-pointer` is provided, thus it is always valid to use `-pg` on those targets.
This test didn't take these targets into account; thus it was failing on Arm64 Windows host machines.
The fix is to explicitly set a target that doesn't require Frame Pointers reservation.
>From 467642bbf6ddfd83ad4d0c6e0f6ec58b226ddf6d Mon Sep 17 00:00:00 2001
From: Daniel Paoliello <danpao at microsoft.com>
Date: Thu, 10 Jul 2025 09:53:34 -0700
Subject: [PATCH] [clang] Use a specific target when testing that
-fomit-frame-pointer and -pg are mutually exclusive
---
clang/test/Driver/frame-pointer-elim.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/clang/test/Driver/frame-pointer-elim.c b/clang/test/Driver/frame-pointer-elim.c
index 0dd7eb0c738db..f00940bd7613d 100644
--- a/clang/test/Driver/frame-pointer-elim.c
+++ b/clang/test/Driver/frame-pointer-elim.c
@@ -44,8 +44,8 @@
// RUN: FileCheck --check-prefix=KEEP-NONE %s
// -pg -fomit-frame-pointer => error.
-// RUN: not %clang -### -S -fomit-frame-pointer -pg %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-OMIT-FP-PG %s
-// RUN: %clang -### -S -fomit-frame-pointer -fno-omit-frame-pointer -pg %s 2>&1 | FileCheck -check-prefix=CHECK-MIX-NO-OMIT-FP-PG %s
+// RUN: not %clang -### --target=i386-linux -S -fomit-frame-pointer -pg %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-OMIT-FP-PG %s
+// RUN: %clang -### --target=i386-linux -S -fomit-frame-pointer -fno-omit-frame-pointer -pg %s 2>&1 | FileCheck -check-prefix=CHECK-MIX-NO-OMIT-FP-PG %s
// CHECK-NO-MIX-OMIT-FP-PG: '-fomit-frame-pointer' not allowed with '-pg'
// CHECK-MIX-NO-OMIT-FP-PG-NOT: '-fomit-frame-pointer' not allowed with '-pg'
More information about the cfe-commits
mailing list