1// REQUIRES: clang-driver 2// REQUIRES: x86-registered-target 3// REQUIRES: amdgpu-registered-target 4 5// RUN: %clang -### -c -target x86_64-linux-gnu -fgpu-rdc \ 6// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \ 7// RUN: 2>&1 | FileCheck %s 8 9// CHECK: {{.*}}clang-offload-bundler{{.*}}"-outputs=hip-output-file-name.o" 10 11// Check -E default output is "-" (stdout). 12 13// RUN: %clang -### -E -target x86_64-linux-gnu \ 14// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \ 15// RUN: 2>&1 | FileCheck -check-prefixes=DASH %s 16 17// RUN: %clang -### -E -save-temps -target x86_64-linux-gnu \ 18// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \ 19// RUN: 2>&1 | FileCheck -check-prefixes=DASH %s 20 21// RUN: %clang -### -E --cuda-device-only -target x86_64-linux-gnu \ 22// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \ 23// RUN: 2>&1 | FileCheck -check-prefixes=CLANG-DASH %s 24 25// RUN: %clang -### -E --cuda-host-only -target x86_64-linux-gnu \ 26// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \ 27// RUN: 2>&1 | FileCheck -check-prefixes=CLANG-DASH %s 28 29// DASH: {{.*}}clang-offload-bundler{{.*}}"-outputs=-" 30// CLANG-DASH: {{.*}}clang{{.*}}"-o" "-" 31 32// Check -E with -o. 33 34// RUN: %clang -### -E -o test.cui -target x86_64-linux-gnu \ 35// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \ 36// RUN: 2>&1 | FileCheck -check-prefixes=OUT %s 37 38// RUN: %clang -### -E -o test.cui -save-temps -target x86_64-linux-gnu \ 39// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \ 40// RUN: 2>&1 | FileCheck -check-prefixes=OUT %s 41 42// RUN: %clang -### -E -o test.cui --cuda-device-only -target x86_64-linux-gnu \ 43// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \ 44// RUN: 2>&1 | FileCheck -check-prefixes=CLANG-OUT %s 45 46// RUN: %clang -### -E -o test.cui --cuda-host-only -target x86_64-linux-gnu \ 47// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \ 48// RUN: 2>&1 | FileCheck -check-prefixes=CLANG-OUT %s 49 50// OUT: {{.*}}clang-offload-bundler{{.*}}"-outputs=test.cui" 51// CLANG-OUT: {{.*}}clang{{.*}}"-o" "test.cui" 52