39 lines · plain
1// REQUIRES: default-pie-on-linux2 3// -fPIC and -fPIE only affects host relocation model.4// device compilation always uses PIC. 5 6// RUN: %clang -### --target=x86_64-unknown-linux-gnu \7// RUN: --offload-arch=gfx906 %s -nogpulib -nogpuinc \8// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s9 10// RUN: %clang -### --target=x86_64-unknown-linux-gnu \11// RUN: -fgpu-rdc --offload-arch=gfx906 %s -nogpulib -nogpuinc \12// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s13 14// RUN: %clang -### --target=x86_64-unknown-linux-gnu \15// RUN: --offload-arch=gfx906 %s -nogpulib -nogpuinc \16// RUN: -fPIC \17// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIC %s18 19// RUN: %clang -### --target=x86_64-unknown-linux-gnu \20// RUN: -fgpu-rdc --offload-arch=gfx906 %s -nogpulib -nogpuinc \21// RUN: -fPIC \22// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIC %s23 24// RUN: %clang -### --target=x86_64-unknown-linux-gnu \25// RUN: --offload-arch=gfx906 %s -nogpulib -nogpuinc \26// RUN: -fPIE \27// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s28 29// RUN: %clang -### --target=x86_64-unknown-linux-gnu \30// RUN: -fgpu-rdc --offload-arch=gfx906 %s -nogpulib -nogpuinc \31// RUN: -fPIE \32// RUN: 2>&1 | FileCheck -check-prefixes=DEV,HOST-PIE %s33 34// DEV-DAG: {{".*clang.*".* "-triple" "amdgcn-amd-amdhsa".* "-mrelocation-model" "pic" "-pic-level" "[1|2]".* "-mframe-pointer=all"}}35// HOST-PIC-DAG: {{".*clang.*".* "-triple" "x86_64-unknown-linux-gnu".* "-mrelocation-model" "pic" "-pic-level" "2"}}36// HOST-PIC-NOT: "-pic-is-pie"37// HOST-PIE-DAG: {{".*clang.*".* "-triple" "x86_64-unknown-linux-gnu".* "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie"}}38// DEV-NOT: {{".*clang.*".* "-triple" "amdgcn-amd-amdhsa".* "-pic-is-pie"}}39