|
| 1 | +/// Test preprocessing capabilities when using -fsycl |
| 2 | +/// Creating a preprocessed file is expected to do an integration header |
| 3 | +/// creation step. |
| 4 | +// RUN: %clangxx -fsycl -E -o %t_output.ii %s -### 2>&1 \ |
| 5 | +// RUN: | FileCheck -check-prefix PREPROC_ONLY %s |
| 6 | +// RUN: %clang_cl -fsycl -P -Fi%t_output.ii %s -### 2>&1 \ |
| 7 | +// RUN: | FileCheck -check-prefix PREPROC_ONLY %s |
| 8 | +// PREPROC_ONLY: clang{{.*}} "-fsycl-is-device"{{.*}} "-E"{{.*}} "-o" "[[DEVICE_OUT:.+\.ii]]" |
| 9 | +// PREPROC_ONLY: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[INTHEADER:.+\.h]]"{{.*}} "-fsyntax-only" |
| 10 | +// PREPROC_ONLY: clang{{.*}} "-include" "[[INTHEADER]]"{{.*}} "-fsycl-is-host"{{.*}} "-o" "[[HOST_OUT:.+\.ii]]" |
| 11 | +// PREPROC_ONLY: clang-offload-bundler{{.*}} "-type=ii"{{.*}} "-outputs={{.+_output.ii}}" "-inputs=[[DEVICE_OUT]],[[HOST_OUT]]" |
| 12 | + |
| 13 | +/// When compiling from preprocessed file, no integration header is expected |
| 14 | +// RUN: touch %t.ii |
| 15 | +// RUN: %clangxx -fsycl %t.ii -### 2>&1 | FileCheck -check-prefix PREPROC_IN %s |
| 16 | +// PREPROC_IN: clang{{.*}} "-fsycl-is-device" |
| 17 | +// PREPROC_IN-NOT: "-fsycl-int-header={{.*}}" |
| 18 | +// PREPROC_IN: clang{{.*}} "-fsycl-is-host" |
| 19 | + |
| 20 | +// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl -E %s -ccc-print-phases 2>&1 \ |
| 21 | +// RUN: | FileCheck -check-prefix PREPROC_PHASES %s |
| 22 | +// PREPROC_PHASES: 0: input, "[[INPUT:.+\.cpp]]", c++, (device-sycl) |
| 23 | +// PREPROC_PHASES: 1: preprocessor, {0}, c++-cpp-output, (device-sycl) |
| 24 | +// PREPROC_PHASES: 2: offload, "device-sycl (spir64-unknown-unknown-sycldevice)" {1}, c++-cpp-output |
| 25 | +// PREPROC_PHASES: 3: input, "[[INPUT]]", c++, (host-sycl) |
| 26 | +// PREPROC_PHASES: 4: compiler, {1}, none, (device-sycl) |
| 27 | +// PREPROC_PHASES: 5: offload, "host-sycl (x86_64-unknown-linux-gnu)" {3}, "device-sycl (spir64-unknown-unknown-sycldevice)" {4}, c++ |
| 28 | +// PREPROC_PHASES: 6: preprocessor, {5}, c++-cpp-output, (host-sycl) |
| 29 | +// PREPROC_PHASES: 7: clang-offload-bundler, {2, 6}, c++-cpp-output, (host-sycl) |
0 commit comments