Skip to content

Commit 9f4c5ca

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web' (#2)
2 parents b24fc16 + d1d6c5d commit 9f4c5ca

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6371,6 +6371,10 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA,
63716371
if (AtTopLevel && !isa<DsymutilJobAction>(JA) && !isa<VerifyJobAction>(JA)) {
63726372
if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT_o))
63736373
return C.addResultFile(FinalOutput->getValue(), &JA);
6374+
// Output to destination for -fsycl-device-only and Windows -o
6375+
if (C.getArgs().hasArg(options::OPT_fsycl_device_only))
6376+
if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT__SLASH_o))
6377+
return C.addResultFile(FinalOutput->getValue(), &JA);
63746378
}
63756379

63766380
// For /P, preprocess to file named after BaseInput.

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ void Sema::CheckDeprecatedSYCLAttributeSpelling(const ParsedAttr &A,
326326
// of a name in the intel vendor namespace. By default, assume the attribute
327327
// retains its original name but changes the namespace. However, some
328328
// attributes were renamed, so we support supplying a new name as well.
329-
if (A.getScopeName()->isStr("intelfpga")) {
329+
if (A.hasScope() && A.getScopeName()->isStr("intelfpga")) {
330330
Diag(A.getLoc(), diag::warn_attribute_spelling_deprecated)
331331
<< "'" + A.getNormalizedFullName() + "'";
332332

clang/test/Driver/sycl-device.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,10 @@
2828
// RUN: | FileCheck -check-prefix=CHECK-SYCL-AUX-TRIPLE %s
2929
// TODO: %clang -### -fsycl -fsycl-device-only -target aarch64-linux-gnu
3030
// CHECK-SYCL-AUX-TRIPLE: clang{{.*}} "-aux-triple" "aarch64-unknown-linux-gnu"
31+
32+
/// Verify output files are properly specified given -o
33+
// RUN: %clang -### -fsycl -fsycl-device-only -o dummy.out %s 2>&1 \
34+
// RUN: | FileCheck -check-prefix=CHECK-OUTPUT-FILE %s
35+
// RUN: %clang_cl -### -fsycl -fsycl-device-only -o dummy.out %s 2>&1 \
36+
// RUN: | FileCheck -check-prefix=CHECK-OUTPUT-FILE %s
37+
// CHECK-OUTPUT-FILE: clang{{.*}} "-o" "dummy.out"

0 commit comments

Comments
 (0)