-
Notifications
You must be signed in to change notification settings - Fork 745
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Driver][SYCL] Allow for -fcf-protection to run on host only (#7251)
The -fcf-protection option is not supported for spir64 targets. This causes an error during device compilation when compiled with -fsycl. Allow the option to be accepted and work on the host compilation side only, emitting a diagnostic that the option is being ignored for the target compiles. before: clang++ -fsycl -fcf-protection -c a.cpp error: option 'cf-protection=return' cannot be specified on this target error: option 'cf-protection=branch' cannot be specified on this target 2 errors generated. after: clang++ -fsycl -fcf-protection -c a.cpp clang-16: warning: ignoring '-fcf-protection' option as it is not currently supported for target 'spir64-unknown-unknown' [-Woption-ignored]
- Loading branch information
Showing
2 changed files
with
18 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
/// Diagnose unsupported options specific to SYCL compilations | ||
// RUN: %clangxx -fsycl -fsanitize=address -fsycl-targets=spir64 -### %s 2>&1 \ | ||
// RUN: | FileCheck %s --check-prefix=SANITIZE -DARCH=spir64 | ||
// RUN: | FileCheck %s -DARCH=spir64 -DOPT=-fsanitize=address | ||
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -fsanitize=address -### %s 2>&1 \ | ||
// RUN: | FileCheck %s --check-prefix=SANITIZE -DARCH=spir64_gen | ||
// RUN: | FileCheck %s -DARCH=spir64_gen -DOPT=-fsanitize=address | ||
// RUN: %clangxx -fsycl -fsycl-targets=spir64_fpga -fsanitize=address -### %s 2>&1 \ | ||
// RUN: | FileCheck %s --check-prefix=SANITIZE -DARCH=spir64_fpga | ||
// RUN: | FileCheck %s -DARCH=spir64_fpga -DOPT=-fsanitize=address | ||
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 -fsanitize=address -### %s 2>&1 \ | ||
// RUN: | FileCheck %s --check-prefix=SANITIZE -DARCH=spir64_x86_64 | ||
// SANITIZE: ignoring '-fsanitize=address' option as it is not currently supported for target '[[ARCH]]{{.*}}' [-Woption-ignored] | ||
// RUN: | FileCheck %s -DARCH=spir64_x86_64 -DOPT=-fsanitize=address | ||
|
||
// RUN: %clangxx -fsycl -fcf-protection -fsycl-targets=spir64 -### %s 2>&1 \ | ||
// RUN: | FileCheck %s -DARCH=spir64 -DOPT=-fcf-protection | ||
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -fcf-protection -### %s 2>&1 \ | ||
// RUN: | FileCheck %s -DARCH=spir64_gen -DOPT=-fcf-protection | ||
// RUN: %clangxx -fsycl -fsycl-targets=spir64_fpga -fcf-protection -### %s 2>&1 \ | ||
// RUN: | FileCheck %s -DARCH=spir64_fpga -DOPT=-fcf-protection | ||
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 -fcf-protection -### %s 2>&1 \ | ||
// RUN: | FileCheck %s -DARCH=spir64_x86_64 -DOPT=-fcf-protection | ||
|
||
// CHECK: ignoring '[[OPT]]' option as it is not currently supported for target '[[ARCH]]{{.*}}' [-Woption-ignored] |