brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.4 KiB · 2855bb5 Raw
104 lines · c
1// Test the driver's control over the PIC behavior for PS5 compiler.2// These consist of tests of the relocation model flags and the3// pic level flags passed to CC1.4//5// CHECK-NO-PIC: "-mrelocation-model" "static"6// CHECK-NO-PIC-NOT: "-pic-level"7// CHECK-NO-PIC-NOT: "-pic-is-pie"8//9// CHECK-DYNAMIC-NO-PIC2: unsupported option '-mdynamic-no-pic'10// CHECK-DYNAMIC-NO-PIC2: "-mrelocation-model" "dynamic-no-pic"11//12// CHECK-PIC2: "-mrelocation-model" "pic"13// CHECK-PIC2: "-pic-level" "2"14//15// CHECK-PIE2: "-mrelocation-model" "pic"16// CHECK-PIE2: "-pic-is-pie"17//18// CHECK-NOPIC-IGNORED: using '-fPIC'19// CHECK-NOPIC-IGNORED: "-mrelocation-model" "pic"20// CHECK-NOPIC-IGNORED: "-pic-level" "2"21//22// CHECK-DIAG-PIC: option '-fno-PIC' was ignored by the PS5 toolchain, using '-fPIC'23// CHECK-DIAG-PIE: option '-fno-PIE' was ignored by the PS5 toolchain, using '-fPIC'24// CHECK-DIAG-pic: option '-fno-pic' was ignored by the PS5 toolchain, using '-fPIC'25// CHECK-DIAG-pie: option '-fno-pie' was ignored by the PS5 toolchain, using '-fPIC'26 27// RUN: %clang -c %s -target x86_64-sie-ps5 -### 2>&1 \28// RUN:   | FileCheck %s --check-prefix=CHECK-PIC229// RUN: %clang -c %s -target x86_64-sie-ps5 -fpic -### 2>&1 \30// RUN:   | FileCheck %s --check-prefix=CHECK-PIC231// RUN: %clang -c %s -target x86_64-sie-ps5 -fPIC -### 2>&1 \32// RUN:   | FileCheck %s --check-prefix=CHECK-PIC233// RUN: %clang -c %s -target x86_64-sie-ps5 -fpie -### 2>&1 \34// RUN:   | FileCheck %s --check-prefix=CHECK-PIE235// RUN: %clang -c %s -target x86_64-sie-ps5 -fPIE -### 2>&1 \36// RUN:   | FileCheck %s --check-prefix=CHECK-PIE237// RUN: %clang -c %s -target x86_64-sie-ps5 -fpic -fno-pic -### 2>&1 \38// RUN:   | FileCheck %s --check-prefix=CHECK-NOPIC-IGNORED39// RUN: %clang -c %s -target x86_64-sie-ps5 -fPIC -fno-PIC -### 2>&1 \40// RUN:   | FileCheck %s --check-prefix=CHECK-NOPIC-IGNORED41// RUN: %clang -c %s -target x86_64-sie-ps5 -fpic -fno-PIC -### 2>&1 \42// RUN:   | FileCheck %s --check-prefix=CHECK-NOPIC-IGNORED43// RUN: %clang -c %s -target x86_64-sie-ps5 -fPIC -fno-pic -### 2>&1 \44// RUN:   | FileCheck %s --check-prefix=CHECK-NOPIC-IGNORED45// RUN: %clang -c %s -target x86_64-sie-ps5 -fpie -fno-pie -### 2>&1 \46// RUN:   | FileCheck %s --check-prefix=CHECK-NOPIC-IGNORED47// RUN: %clang -c %s -target x86_64-sie-ps5 -fPIE -fno-PIE -### 2>&1 \48// RUN:   | FileCheck %s --check-prefix=CHECK-NOPIC-IGNORED49// RUN: %clang -c %s -target x86_64-sie-ps5 -fpie -fno-PIE -### 2>&1 \50// RUN:   | FileCheck %s --check-prefix=CHECK-NOPIC-IGNORED51// RUN: %clang -c %s -target x86_64-sie-ps5 -fPIE -fno-pie -### 2>&1 \52// RUN:   | FileCheck %s --check-prefix=CHECK-NOPIC-IGNORED53// RUN: %clang -c %s -target x86_64-sie-ps5 -fpie -fno-pic -### 2>&1 \54// RUN:   | FileCheck %s --check-prefix=CHECK-NOPIC-IGNORED55// RUN: %clang -c %s -target x86_64-sie-ps5 -fpic -fno-pie -### 2>&1 \56// RUN:   | FileCheck %s --check-prefix=CHECK-NOPIC-IGNORED57// RUN: %clang -c %s -target x86_64-sie-ps5 -fpic -fPIC -### 2>&1 \58// RUN:   | FileCheck %s --check-prefix=CHECK-PIC259// RUN: %clang -c %s -target x86_64-sie-ps5 -fPIC -fpic -### 2>&1 \60// RUN:   | FileCheck %s --check-prefix=CHECK-PIC261// RUN: %clang -c %s -target x86_64-sie-ps5 -fpic -fPIE -fpie -### 2>&1 \62// RUN:   | FileCheck %s --check-prefix=CHECK-PIE263// RUN: %clang -c %s -target x86_64-sie-ps5 -fpie -fPIC -fPIE -### 2>&1 \64// RUN:   | FileCheck %s --check-prefix=CHECK-PIE265//66// Defaults change for PS5.67// RUN: %clang -c %s -target x86_64-sie-ps5 -### 2>&1 \68// RUN:   | FileCheck %s --check-prefix=CHECK-PIC269// RUN: %clang -c %s -target x86_64-sie-ps5 -fno-pic -### 2>&1 \70// RUN:   | FileCheck %s --check-prefix=CHECK-NOPIC-IGNORED71// RUN: %clang -c %s -target x86_64-sie-ps5 -fno-PIC -### 2>&1 \72// RUN:   | FileCheck %s --check-prefix=CHECK-NOPIC-IGNORED73//74// Disregard any of the PIC-specific flags if we have a trump-card flag.75// RUN: %clang -c %s -target x86_64-sie-ps5 -mkernel -fPIC -### 2>&1 \76// RUN:   | FileCheck %s --check-prefix=CHECK-NO-PIC77// RUN: not %clang -c %s --target=x86_64-sie-ps5 -mdynamic-no-pic -fPIC -### 2>&1 \78// RUN:   | FileCheck %s --check-prefix=CHECK-DYNAMIC-NO-PIC279//80// The -static argument *doesn't* override PIC: -static only affects81// linking, and -fPIC only affects code generation.82// RUN: %clang -c %s -target x86_64-sie-ps5 -static -fPIC -### 2>&1 \83// RUN:   | FileCheck %s --check-prefix=CHECK-PIC284//85// -fno-PIC etc. is obeyed if -mcmodel=kernel is also present.86// RUN: %clang -c %s -target x86_64-sie-ps5 -mcmodel=kernel -fno-PIC -### 2>&1 \87// RUN:   | FileCheck %s --check-prefix=CHECK-NO-PIC88// RUN: %clang -c %s -target x86_64-sie-ps5 -mcmodel=kernel -fno-PIE -### 2>&1 \89// RUN:   | FileCheck %s --check-prefix=CHECK-NO-PIC90// RUN: %clang -c %s -target x86_64-sie-ps5 -mcmodel=kernel -fno-pic -### 2>&1 \91// RUN:   | FileCheck %s --check-prefix=CHECK-NO-PIC92// RUN: %clang -c %s -target x86_64-sie-ps5 -mcmodel=kernel -fno-pie -### 2>&1 \93// RUN:   | FileCheck %s --check-prefix=CHECK-NO-PIC94//95// Verify that we reflect the option the user specified, when we ignore it.96// RUN: %clang -c %s -target x86_64-sie-ps5 -fno-PIC -### 2>&1 \97// RUN:   | FileCheck %s --check-prefix=CHECK-DIAG-PIC98// RUN: %clang -c %s -target x86_64-sie-ps5 -fno-PIE -### 2>&1 \99// RUN:   | FileCheck %s --check-prefix=CHECK-DIAG-PIE100// RUN: %clang -c %s -target x86_64-sie-ps5 -fno-pic -### 2>&1 \101// RUN:   | FileCheck %s --check-prefix=CHECK-DIAG-pic102// RUN: %clang -c %s -target x86_64-sie-ps5 -fno-pie -### 2>&1 \103// RUN:   | FileCheck %s --check-prefix=CHECK-DIAG-pie104