|
| 1 | +// Check that -fcf-protection does not get passed to the device-side |
| 2 | +// compilation. |
| 3 | + |
| 4 | +// RUN: %clang -### -x cuda --target=x86_64-unknown-linux-gnu -nogpulib \ |
| 5 | +// RUN: -nogpuinc --offload-arch=sm_52 -fcf-protection=full -c %s 2>&1 \ |
| 6 | +// RUN: | FileCheck %s --check-prefix=CUDA |
| 7 | + |
| 8 | +// CUDA: "-cc1" "-triple" "nvptx64-nvidia-cuda" |
| 9 | +// CUDA-NOT: "-fcf-protection=full" |
| 10 | +// CUDA: "-cc1" "-triple" "x86_64-unknown-linux-gnu" |
| 11 | +// CUDA: "-fcf-protection=full" |
| 12 | + |
| 13 | +// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu -nogpulib \ |
| 14 | +// RUN: -nogpuinc --offload-arch=gfx90a -fcf-protection=full -c %s 2>&1 \ |
| 15 | +// RUN: | FileCheck %s --check-prefix=HIP |
| 16 | + |
| 17 | +// HIP: "-cc1" "-triple" "amdgcn-amd-amdhsa" |
| 18 | +// HIP-NOT: "-fcf-protection=full" |
| 19 | +// HIP: "-cc1" "-triple" "x86_64-unknown-linux-gnu" |
| 20 | +// HIP: "-fcf-protection=full" |
| 21 | + |
| 22 | +// RUN: %clang -### -x c --target=x86_64-unknown-linux-gnu -nogpulib -fopenmp=libomp \ |
| 23 | +// RUN: -nogpuinc --offload-arch=gfx90a -fcf-protection=full -c %s 2>&1 \ |
| 24 | +// RUN: | FileCheck %s --check-prefix=OMP |
| 25 | + |
| 26 | +// OMP: "-cc1" "-triple" "x86_64-unknown-linux-gnu" |
| 27 | +// OMP: "-fcf-protection=full" |
| 28 | +// OMP: "-cc1" "-triple" "amdgcn-amd-amdhsa" |
| 29 | +// OMP-NOT: "-fcf-protection=full" |
| 30 | +// OMP: "-cc1" "-triple" "x86_64-unknown-linux-gnu" |
| 31 | +// OMP: "-fcf-protection=full" |
| 32 | + |
| 33 | +// RUN: %clang -### -x c --target=nvptx64-nvidia-cuda -nogpulib -nogpuinc \ |
| 34 | +// RUN: -march=sm_52 -fcf-protection=full -c %s 2>&1 \ |
| 35 | +// RUN: | FileCheck %s --check-prefix=DIRECT |
| 36 | +// RUN: %clang -### -x c --target=amdgcn-amd-amdhsa -nogpulib -nogpuinc \ |
| 37 | +// RUN: -mcpu=gfx90a -fcf-protection=full -c %s 2>&1 \ |
| 38 | +// RUN: | FileCheck %s --check-prefix=DIRECT |
| 39 | +// DIRECT: "-fcf-protection=full" |
0 commit comments