[flang-commits] [flang] e64f8e0 - [flang][Driver] Guard check for pic/pie settings without driver flags (#143530)

via flang-commits flang-commits at lists.llvm.org
Wed Jun 11 08:17:58 PDT 2025


Author: Krzysztof Parzyszek
Date: 2025-06-11T10:17:54-05:00
New Revision: e64f8e043cdfc394fd31e157c8c5fb25ca85bd2f

URL: https://github.com/llvm/llvm-project/commit/e64f8e043cdfc394fd31e157c8c5fb25ca85bd2f
DIFF: https://github.com/llvm/llvm-project/commit/e64f8e043cdfc394fd31e157c8c5fb25ca85bd2f.diff

LOG: [flang][Driver] Guard check for pic/pie settings without driver flags (#143530)

The default relocation model for clang depends on the cmake flag
CLANG_DEFAULT_PIE_ON_LINUX. By default it is set to ON, but when it's
OFF, the default relocation model will be "static".
The outcome of the test running clang without any PIC/PIE flags will
depend on the cmake flag, so make sure it only runs when the flag is ON.

Added: 
    

Modified: 
    flang/test/Driver/pic-flags.f90

Removed: 
    


################################################################################
diff  --git a/flang/test/Driver/pic-flags.f90 b/flang/test/Driver/pic-flags.f90
index cb62d353cc18c..5a06163c485cd 100644
--- a/flang/test/Driver/pic-flags.f90
+++ b/flang/test/Driver/pic-flags.f90
@@ -1,6 +1,6 @@
 ! RUN: %if aarch64-registered-target %{ %flang -v -S -emit-llvm -o - %s --target=aarch64-linux-gnu -fno-pie 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-STATIC,CHECK-STATIC-IR %}
 
-! RUN: %if aarch64-registered-target %{ %flang -v -S -emit-llvm -o - %s --target=aarch64-linux-gnu 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-PIE-LEVEL2,CHECK-PIE-LEVEL2-IR %}
+! RUN: %if aarch64-registered-target && clang_default_pie_on_linux %{ %flang -v -S -emit-llvm -o - %s --target=aarch64-linux-gnu 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-PIE-LEVEL2,CHECK-PIE-LEVEL2-IR %}
 ! RUN: %if aarch64-registered-target %{ %flang -v -S -emit-llvm -o - %s --target=aarch64-linux-gnu -fpie 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-PIE-LEVEL1,CHECK-PIE-LEVEL1-IR %}
 ! RUN: %if aarch64-registered-target %{ %flang -v -S -emit-llvm -o - %s --target=aarch64-linux-gnu -fPIE 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-PIE-LEVEL2,CHECK-PIE-LEVEL2-IR %}
 


        


More information about the flang-commits mailing list