[llvm] [flang] Fix the CHECK: directive to ensure flagging RWE (NFC) (PR #187186)

Kelvin Li via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 17 20:52:53 PDT 2026


https://github.com/kkwli created https://github.com/llvm/llvm-project/pull/187186

The current check does not catch the following case output on powerpc64le:
```
GNU_EH_FRAME   0x000ed8 0x0000000000000ed8 0x0000000000000ed8 0x000074 0x000074 R   0x4
GNU_STACK      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RWE 0x10
GNU_RELRO      0x00fca8 0x000000000001fca8 0x000000000001fca8 0x000358 0x000358 R   0x1
```

@Saieiei 


>From 754650e8bfa933e060ebb344d063362a4fcb2204 Mon Sep 17 00:00:00 2001
From: Kelvin Li <kli at ca.ibm.com>
Date: Tue, 17 Mar 2026 23:41:42 -0400
Subject: [PATCH] [flang] Fix the CHECK: directive to ensure flagging RWE (NFC)

---
 flang-rt/test/Driver/safe-trampoline-gnustack.f90 | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/flang-rt/test/Driver/safe-trampoline-gnustack.f90 b/flang-rt/test/Driver/safe-trampoline-gnustack.f90
index 88ef62d436e51a..c4cd365952eef7 100644
--- a/flang-rt/test/Driver/safe-trampoline-gnustack.f90
+++ b/flang-rt/test/Driver/safe-trampoline-gnustack.f90
@@ -11,9 +11,7 @@
 ! RUN: llvm-readelf -lW %t | FileCheck %s
 
 ! Ensure GNU_STACK exists and has RW flags (no E).
-! CHECK: GNU_STACK
-! CHECK-SAME: RW
-! CHECK-NOT: RWE
+! CHECK: GNU_STACK{{.*}}RW{{[^E]|$}}
 
 subroutine host_proc(x, res)
   implicit none



More information about the llvm-commits mailing list