|
14 | 14 | // CHECK-AMD: 4: offload, "device-sycl (amdgcn-amd-amdhsa:gfx90a)" {3}, assembler |
15 | 15 |
|
16 | 16 | /// Check -fsycl-device-obj=asm for Nvidia. |
17 | | -// RUN: %clang -fsycl-device-only -fsycl -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend=nvptx64-nvidia-cuda "--cuda-gpu-arch=sm_50" -fsycl-device-obj=asm -S %s 2>&1 -ccc-print-phases -o - | FileCheck %s --check-prefix=CHECK-PTX |
| 17 | +// RUN: %clang -fsycl-device-only -fsycl -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_50 -fsycl-device-obj=asm -S %s 2>&1 -ccc-print-phases -o - | FileCheck %s --check-prefix=CHECK-PTX |
18 | 18 | // CHECK-PTX: 0: input, "{{.+\.cpp}}", c++, (device-sycl, sm_50) |
19 | 19 | // CHECK-PTX: 1: preprocessor, {0}, c++-cpp-output, (device-sycl, sm_50) |
20 | 20 | // CHECK-PTX: 2: compiler, {1}, ir, (device-sycl, sm_50) |
21 | 21 | // CHECK-PTX: 3: backend, {2}, assembler, (device-sycl, sm_50) |
22 | 22 | // CHECK-PTX: 4: offload, "device-sycl (nvptx64-nvidia-cuda:sm_50)" {3}, assembler |
23 | 23 |
|
24 | 24 | /// Check -fsycl-device-obj option when emitting llvm IR. |
25 | | -// RUN: %clang -fsycl-device-only -fsycl -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend=nvptx64-nvidia-cuda "--cuda-gpu-arch=sm_50" -fsycl-device-obj=llvmir -S %s 2>&1 -ccc-print-phases -o - | FileCheck %s --check-prefix=CHECK-LLVMIR |
| 25 | +// RUN: %clang -fsycl-device-only -fsycl -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_50 -fsycl-device-obj=llvmir -S %s 2>&1 -ccc-print-phases -o - | FileCheck %s --check-prefix=CHECK-LLVMIR |
26 | 26 | // CHECK-LLVMIR: 0: input, "{{.+\.cpp}}", c++, (device-sycl, sm_50) |
27 | 27 | // CHECK-LLVMIR: 1: preprocessor, {0}, c++-cpp-output, (device-sycl, sm_50) |
28 | 28 | // CHECK-LLVMIR: 2: compiler, {1}, ir, (device-sycl, sm_50) |
29 | 29 | // CHECK-LLVMIR: 3: offload, "device-sycl (nvptx64-nvidia-cuda:sm_50)" {2}, ir |
| 30 | + |
| 31 | +/// -fsycl-device-obj=asm should always be accompanied by -fsycl-device-only |
| 32 | +/// and -S, check that the compiler issues a correct warning message: |
| 33 | +// RUN: %clang -fsycl-device-only -fsycl -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_50 -fsycl-device-obj=asm %s 2>&1 -o - | FileCheck %s --check-prefix=CHECK-NO-DEV-ONLY-NO-S |
| 34 | +// CHECK-NO-DEV-ONLY-NO-S: warning: -fsycl-device-obj=asm flag has an effect only when compailing device code and emitting assembly, make sure both -fsycl-device-only and -S flags are present. The option will be ignored [-Wsycl-target] |
| 35 | + |
| 36 | +/// -fsycl-device-obj=asm will finish at generating assembly stage, hence |
| 37 | +/// inform users that generating library will not be possible (ignore -c) |
| 38 | +// RUN: %clang -fsycl-device-only -fsycl -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_50 -fsycl-device-obj=asm %s 2>&1 -fsycl-device-only -S -c -o - | FileCheck %s --check-prefix=CHECK-DASH-C-IGNORE |
| 39 | +// CHECK-DASH-C-IGNORE: warning: argument unused during compilation: '-c' [-Wunused-command-line-argument] |
0 commit comments