[LLVM] Fix Maintainers.md formatting (NFC)
[llvm-project.git] / flang / test / Driver / pic-flags.f90
blobcb62d353cc18c4721b478c6871c31781a77afd27
1 ! 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 %}
3 ! 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 %}
4 ! 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 %}
5 ! 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 %}
7 ! RUN: %if aarch64-registered-target %{ %flang -v -S -emit-llvm -o - %s --target=aarch64-linux-gnu -fpic 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-PIC-LEVEL1,CHECK-PIC-LEVEL1-IR %}
8 ! RUN: %if aarch64-registered-target %{ %flang -v -S -emit-llvm -o - %s --target=aarch64-linux-gnu -fPIC 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-PIC-LEVEL2,CHECK-PIC-LEVEL2-IR %}
10 ! RUN: %if x86-registered-target %{ %flang -v -### -o - %s --target=i386-apple-darwin -mdynamic-no-pic 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-DYNAMIC-NO-PIC-32 %}
11 ! RUN: %if x86-registered-target %{ %flang -v -### -o - %s --target=x86_64-apple-darwin -mdynamic-no-pic 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-DYNAMIC-NO-PIC-64 %}
13 ! RUN: %if arm-registered-target %{ %flang -v -### -o - %s --target=arm-none-eabi -fropi 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-ROPI %}
14 ! RUN: %if arm-registered-target %{ %flang -v -### -o - %s --target=arm-none-eabi -frwpi 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-RWPI %}
15 ! RUN: %if arm-registered-target %{ %flang -v -### -o - %s --target=arm-none-eabi -fropi -frwpi 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-ROPI-RWPI %}
17 ! CHECK: -fc1
20 !! -fno-pie.
21 ! CHECK-STATIC: -mrelocation-model static
22 ! CHECK-STATIC-NOT: -pic
24 ! CHECK-STATIC-IR-NOT: {{PIE|PIC}} Level
27 !! -fpic.
28 ! CHECK-PIC-LEVEL1: -mrelocation-model pic -pic-level 1
29 ! CHECK-PIC-LEVEL1-NOT: -pic-is-pie
31 ! CHECK-PIC-LEVEL1-IR-NOT: "PIE Level"
32 ! CHECK-PIC-LEVEL1-IR: !"PIC Level", i32 1}
33 ! CHECK-PIC-LEVEL1-IR-NOT: "PIE Level"
36 !! -fPIC.
37 ! CHECK-PIC-LEVEL2: -mrelocation-model pic -pic-level 2
38 ! CHECK-PIC-LEVEL2-NOT: -pic-is-pie
40 ! CHECK-PIC-LEVEL2-IR-NOT: "PIE Level"
41 ! CHECK-PIC-LEVEL2-IR: !"PIC Level", i32 2}
42 ! CHECK-PIC-LEVEL2-IR-NOT: "PIE Level"
45 !! -fpie.
46 ! CHECK-PIE-LEVEL1: -mrelocation-model pic -pic-level 1 -pic-is-pie
47 ! CHECK-PIE-LEVEL1-IR: !"PIC Level", i32 1}
48 ! CHECK-PIE-LEVEL1-IR: !"PIE Level", i32 1}
51 !! -fPIE.
52 ! CHECK-PIE-LEVEL2: -mrelocation-model pic -pic-level 2 -pic-is-pie
53 ! CHECK-PIE-LEVEL2-IR: !"PIC Level", i32 2}
54 ! CHECK-PIE-LEVEL2-IR: !"PIE Level", i32 2}
57 !! -mdynamic-no-pic
58 ! CHECK-DYNAMIC-NO-PIC-32: "-mrelocation-model" "dynamic-no-pic"
59 ! CHECK-DYNAMIC-NO-PIC-32-NOT: "-pic-level"
60 ! CHECK-DYNAMIC-NO-PIC-32-NOT: "-pic-is-pie"
62 ! CHECK-DYNAMIC-NO-PIC-64: "-mrelocation-model" "dynamic-no-pic" "-pic-level" "2"
63 ! CHECK-DYNAMIC-NO-PIC-64-NOT: "-pic-is-pie"
66 !! -fropi -frwpi
67 ! CHECK-ROPI: "-mrelocation-model" "ropi"
68 ! CHECK-ROPI-NOT: "-pic
70 ! CHECK-RWPI: "-mrelocation-model" "rwpi"
71 ! CHECK-RWPI-NOT: "-pic
73 ! CHECK-ROPI-RWPI: "-mrelocation-model" "ropi-rwpi"
74 ! CHECK-ROPI-RWPI-NOT: "-pic