File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -4750,9 +4750,11 @@ Action *Driver::ConstructPhaseAction(
4750
4750
return C.MakeAction <BackendJobAction>(Input, Output);
4751
4751
}
4752
4752
if (Args.hasArg (options::OPT_fsycl_device_only)) {
4753
+ types::ID OutputType =
4754
+ Args.hasArg (options::OPT_S) ? types::TY_LLVM_IR : types::TY_LLVM_BC;
4753
4755
if (Args.hasFlag (options::OPT_fsycl_use_bitcode,
4754
4756
options::OPT_fno_sycl_use_bitcode, true ))
4755
- return C.MakeAction <BackendJobAction>(Input, types::TY_LLVM_BC );
4757
+ return C.MakeAction <BackendJobAction>(Input, OutputType );
4756
4758
// Use of -fsycl-device-only creates a bitcode file, we need to translate
4757
4759
// that to a SPIR-V file with -fno-sycl-use-bitcode
4758
4760
auto *BackendAction =
Original file line number Diff line number Diff line change 11
11
12
12
// RUN: %clang -### -fsycl-device-only -c %s 2>&1 | FileCheck %s --check-prefix=DEFAULT
13
13
// RUN: %clang -### -fsycl-device-only %s 2>&1 | FileCheck %s --check-prefix=DEFAULT
14
+ // RUN: %clang -### -fsycl-device-only -S %s 2>&1 | FileCheck %s --check-prefix=TEXTUAL
14
15
// RUN: %clang -### -fsycl-device-only -fsycl %s 2>&1 | FileCheck %s --check-prefix=DEFAULT
15
16
// RUN: %clang -### -fsycl-device-only -fno-sycl-use-bitcode -c %s 2>&1 | FileCheck %s --check-prefix=NO-BITCODE
16
17
// RUN: %clang -### -target spir64-unknown-linux-sycldevice -c -emit-llvm %s 2>&1 | FileCheck %s --check-prefix=TARGET
27
28
// NO-BITCODE: "{{.*}}llvm-spirv"{{.*}} "-spirv-max-version=1.1"{{.*}} "-spirv-ext=+all"
28
29
// TARGET: "-triple" "spir64-unknown-linux-sycldevice"{{.*}} "-fsycl-is-device"{{.*}} "-emit-llvm-bc"
29
30
// COMBINED: "-triple" "spir64-unknown-{{.*}}-sycldevice"{{.*}} "-fsycl-is-device"{{.*}} "-emit-llvm-bc"
31
+ // TEXTUAL: "-triple" "spir64-unknown-{{.*}}-sycldevice{{.*}}" "-fsycl-is-device"{{.*}} "-emit-llvm"
30
32
31
33
/// Verify -fsycl-device-only phases
32
34
// RUN: %clang -### -ccc-print-phases -fsycl-device-only %s 2>&1 | FileCheck %s --check-prefix=DEFAULT-PHASES
You can’t perform that action at this time.
0 commit comments