Aaron Ballman c165a99a1b [SYCL] Rework the SYCL driver options
SYCL compilations initiated by the driver will spawn off one or more
frontend compilation jobs (one for device and one for host). This patch
reworks the driver options to make upstreaming this from the downstream
SYCL fork easier.

This patch introduces a language option to identify host executions
(SYCLIsHost) and a -cc1 frontend option to enable this mode. -fsycl and
-fno-sycl become driver-only options that are rejected when passed to
-cc1. This is because the frontend and beyond should be looking at
whether the user is doing a device or host compilation specifically.
Because the frontend should only ever be in one mode or the other,
-fsycl-is-device and -fsycl-is-host are mutually exclusive options.
2021-03-17 08:27:19 -04:00

14 lines
768 B
C++

// Test that we disallow -cc1 -fsycl, even when specifying device or host mode.
// RUN: not %clang_cc1 -fsycl %s 2>&1 | FileCheck --check-prefix=ERROR %s
// RUN: not %clang_cc1 -fsycl -fsycl-is-device %s 2>&1 | FileCheck --check-prefix=ERROR %s
// RUN: not %clang_cc1 -fsycl -fsycl-is-host %s 2>&1 | FileCheck --check-prefix=ERROR %s
// ERROR: error: unknown argument: '-fsycl'
// Test that you cannot specify -fsycl-is-device and -fsycl-is-host at the same time.
// RUN: not %clang_cc1 -fsycl-is-device -fsycl-is-host %s 2>&1 | FileCheck --check-prefix=ERROR-BOTH %s
// RUN: not %clang_cc1 -fsycl-is-host -fsycl-is-device %s 2>&1 | FileCheck --check-prefix=ERROR-BOTH %s
// ERROR-BOTH: error: invalid argument '-fsycl-is-device' not allowed with '-fsycl-is-host'