2022-04-13 04:29:46 +08:00
|
|
|
// REQUIRES: amdgpu-registered-target, default-pie-on-linux
|
2020-09-29 00:07:06 +08:00
|
|
|
|
|
|
|
// -fPIC and -fPIE only affects host relocation model.
|
|
|
|
// device compilation always uses PIC.
|
|
|
|
|
|
|
|
// RUN: %clang -### -target x86_64-unknown-linux-gnu \
|
|
|
|
// RUN: --offload-arch=gfx906 %s -nogpulib -nogpuinc \
|
2022-04-09 14:40:18 +08:00
|
|
|
// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s
|
2020-09-29 00:07:06 +08:00
|
|
|
|
|
|
|
// RUN: %clang -### -target x86_64-unknown-linux-gnu \
|
|
|
|
// RUN: -fgpu-rdc --offload-arch=gfx906 %s -nogpulib -nogpuinc \
|
2022-04-09 14:40:18 +08:00
|
|
|
// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s
|
2020-09-29 00:07:06 +08:00
|
|
|
|
|
|
|
// RUN: %clang -### -target x86_64-unknown-linux-gnu \
|
|
|
|
// RUN: --offload-arch=gfx906 %s -nogpulib -nogpuinc \
|
|
|
|
// RUN: -fPIC \
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIC %s
|
|
|
|
|
|
|
|
// RUN: %clang -### -target x86_64-unknown-linux-gnu \
|
|
|
|
// RUN: -fgpu-rdc --offload-arch=gfx906 %s -nogpulib -nogpuinc \
|
|
|
|
// RUN: -fPIC \
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIC %s
|
|
|
|
|
|
|
|
// RUN: %clang -### -target x86_64-unknown-linux-gnu \
|
|
|
|
// RUN: --offload-arch=gfx906 %s -nogpulib -nogpuinc \
|
|
|
|
// RUN: -fPIE \
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s
|
|
|
|
|
|
|
|
// RUN: %clang -### -target x86_64-unknown-linux-gnu \
|
|
|
|
// RUN: -fgpu-rdc --offload-arch=gfx906 %s -nogpulib -nogpuinc \
|
|
|
|
// RUN: -fPIE \
|
|
|
|
// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s
|
|
|
|
|
2021-01-01 05:37:35 +08:00
|
|
|
// DEV-DAG: {{".*clang.*".* "-triple" "amdgcn-amd-amdhsa".* "-mrelocation-model" "pic" "-pic-level" "[1|2]".* "-mframe-pointer=all"}}
|
|
|
|
// HOST-PIC-DAG: {{".*clang.*".* "-triple" "x86_64-unknown-linux-gnu".* "-mrelocation-model" "pic" "-pic-level" "2"}}
|
|
|
|
// HOST-PIC-NOT: "-pic-is-pie"
|
2020-09-29 00:07:06 +08:00
|
|
|
// HOST-PIE-DAG: {{".*clang.*".* "-triple" "x86_64-unknown-linux-gnu".* "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie"}}
|
|
|
|
// DEV-NOT: {{".*clang.*".* "-triple" "amdgcn-amd-amdhsa".* "-pic-is-pie"}}
|