Skip to content

Commit f0cadb1

Browse files
authored
[Driver][SYCL] Allow for -mlong-double to be passed for SPIR target (#2729)
The use of -mlong-double was restricted to x86 and ppc. Expand this to allow for spir arch targets.
1 parent 4fb00c5 commit f0cadb1

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4903,7 +4903,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
49034903
}
49044904

49054905
if (Arg *A = Args.getLastArg(options::OPT_LongDouble_Group)) {
4906-
if (TC.getTriple().isX86())
4906+
if (TC.getTriple().isX86() || TC.getTriple().isSPIR())
49074907
A->render(Args, CmdArgs);
49084908
else if ((TC.getArch() == llvm::Triple::ppc || TC.getTriple().isPPC64()) &&
49094909
(A->getOption().getID() != options::OPT_mlong_double_80))

clang/test/Driver/mlong-double-128.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// RUN: %clang -target powerpc64-pc-freebsd12 -c -### %s -mlong-double-128 2>&1 | FileCheck %s
33
// RUN: %clang -target powerpc64le-linux-musl -c -### %s -mlong-double-128 2>&1 | FileCheck %s
44
// RUN: %clang -target i686-linux-gnu -c -### %s -mlong-double-128 2>&1 | FileCheck %s
5+
// RUN: %clang -target spir64-unknown-unknown-sycldevice -c -### %s -mlong-double-128 2>&1 | FileCheck %s
56

67
// RUN: %clang -target x86_64-linux-musl -c -### %s -mlong-double-128 -mlong-double-80 2>&1 | FileCheck --implicit-check-not=-mlong-double-128 /dev/null
78
// RUN: %clang -target x86_64-linux-musl -c -### %s -mlong-double-80 -mlong-double-128 2>&1 | FileCheck %s

clang/test/Driver/mlong-double-64.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// RUN: %clang -target powerpc64le-linux-musl -c -### %s -mlong-double-64 2>&1 | FileCheck %s
44
// RUN: %clang -target i686-linux-gnu -c -### %s -mlong-double-64 2>&1 | FileCheck %s
55
// RUN: %clang -target x86_64-linux-musl -c -### %s -mlong-double-64 2>&1 | FileCheck %s
6+
// RUN: %clang -target spir64-unknown-unknown-sycldevice -c -### %s -mlong-double-64 2>&1 | FileCheck %s
67

78
// CHECK: "-mlong-double-64"
89

0 commit comments

Comments
 (0)