1 // REQUIRES: x86-registered-target
2 // REQUIRES: amdgpu-registered-target
4 // Output bundled code objects for combined compilation.
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
9 // CHECK: {{.*}}clang-offload-bundler{{.*}}"-output=hip-output-file-name.o"
11 // Check -E default output is "-" (stdout).
12 // If there are multiple preprocessor expansion outputs clang-offload-bundler
13 // is used to bundle the final output.
15 // Output bundled PPE for one GPU for mixed compliation.
16 // RUN: %clang -### -E --target=x86_64-linux-gnu \
17 // RUN: --cuda-gpu-arch=gfx803 %s \
18 // RUN: 2>&1 | FileCheck -check-prefixes=DASH %s
20 // Output unbundled PPE for one GPU for device only compilation.
21 // RUN: %clang -### -E --cuda-device-only --target=x86_64-linux-gnu \
22 // RUN: --cuda-gpu-arch=gfx803 %s \
23 // RUN: 2>&1 | FileCheck -check-prefixes=CLANG-DASH %s
25 // Output bundled PPE for two GPUs for mixed compilation.
26 // RUN: %clang -### -E --target=x86_64-linux-gnu \
27 // RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
28 // RUN: 2>&1 | FileCheck -check-prefixes=DASH %s
30 // Output bundled PPE for two GPUs for mixed compilation with -save-temps.
31 // RUN: %clang -### -E -save-temps --target=x86_64-linux-gnu \
32 // RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
33 // RUN: 2>&1 | FileCheck -check-prefixes=DASH %s
35 // Output unbundled PPE for two GPUs for device only compilation.
36 // RUN: %clang -### -E --cuda-device-only --target=x86_64-linux-gnu \
37 // RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
38 // RUN: 2>&1 | FileCheck -check-prefixes=CLANG-DASH %s
40 // Output bundled PPE for two GPUs for device only compilation with --gpu-bundle-output.
41 // RUN: %clang -### -E --cuda-device-only --target=x86_64-linux-gnu \
42 // RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s --gpu-bundle-output \
43 // RUN: 2>&1 | FileCheck -check-prefixes=DASH %s
45 // Output unbundled PPE for two GPUs for device only compilation with --no-gpu-bundle-output.
46 // RUN: %clang -### -E --cuda-device-only --target=x86_64-linux-gnu \
47 // RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s --no-gpu-bundle-output \
48 // RUN: 2>&1 | FileCheck -check-prefixes=CLANG-DASH %s
50 // Output unbundled PPE for host only compilation.
51 // RUN: %clang -### -E --cuda-host-only --target=x86_64-linux-gnu \
52 // RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
53 // RUN: 2>&1 | FileCheck -check-prefixes=CLANG-DASH %s
55 // DASH-NOT: {{.*}}clang{{.*}}"-o" "-"
56 // DASH: {{.*}}clang-offload-bundler{{.*}}"-output=-"
57 // CLANG-DASH: {{.*}}clang{{.*}}"-o" "-"
58 // CLANG-DASH-NOT: {{.*}}clang-offload-bundler{{.*}}"-output=-"
62 // Output bundled PPE for two GPUs for mixed compilation.
63 // RUN: %clang -### -E -o test.cui --target=x86_64-linux-gnu \
64 // RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
65 // RUN: 2>&1 | FileCheck -check-prefixes=OUT %s
67 // Output bundled PPE for two GPUs for mixed compilation.
68 // RUN: %clang -### -E -o test.cui -save-temps --target=x86_64-linux-gnu \
69 // RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
70 // RUN: 2>&1 | FileCheck -check-prefixes=OUT %s
72 // Output bundled PPE for two GPUs for device only compilation with --gpu-bundle-output.
73 // RUN: %clang -### -E -o test.cui --cuda-device-only --target=x86_64-linux-gnu \
74 // RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 --gpu-bundle-output %s \
75 // RUN: 2>&1 | FileCheck -check-prefixes=OUT %s
77 // Output unbundled PPE for two GPUs for device only compilation.
78 // RUN: %clang -### -E -o test.cui --cuda-host-only --target=x86_64-linux-gnu \
79 // RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 %s \
80 // RUN: 2>&1 | FileCheck -check-prefixes=CLANG-OUT %s
82 // OUT-NOT: {{.*}}clang{{.*}}"-o" "test.cui"
83 // OUT: {{.*}}clang-offload-bundler{{.*}}"-output=test.cui"
84 // CLANG-OUT: {{.*}}clang{{.*}}"-o" "test.cui"
85 // CLANG-OUT-NOT: {{.*}}clang-offload-bundler{{.*}}"-output=test.cui"