Skip to content

Commit c0d3078

Browse files
committed
preserving test
1 parent 8b69549 commit c0d3078

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

sycl/test-e2e/KernelCompiler/kernel_compiler_sycl.cpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ void test_build_and_run(bool readingFromCache) {
155155
"kernel bundle extension: "
156156
<< q.get_device().get_info<sycl::info::device::name>()
157157
<< std::endl;
158+
assert(ok);
158159
return;
159160
}
160161

@@ -239,6 +240,41 @@ void test_error() {
239240
}
240241
}
241242

243+
void test_unsupported_options() {
244+
namespace syclex = sycl::ext::oneapi::experimental;
245+
using source_kb = sycl::kernel_bundle<sycl::bundle_state::ext_oneapi_source>;
246+
247+
sycl::queue q;
248+
sycl::context ctx = q.get_context();
249+
250+
bool ok =
251+
q.get_device().ext_oneapi_can_compile(syclex::source_language::sycl);
252+
if (!ok) {
253+
return;
254+
}
255+
256+
source_kb kbSrc = syclex::create_kernel_bundle_from_source(
257+
ctx, syclex::source_language::sycl, "");
258+
std::vector<sycl::device> devs = kbSrc.get_devices();
259+
260+
auto CheckUnsupported = [&](const std::vector<std::string> &flags) {
261+
try {
262+
syclex::build(kbSrc, devs,
263+
syclex::properties{syclex::build_options{flags}});
264+
assert(false && "unsupported option not detected");
265+
} catch (sycl::exception &e) {
266+
assert(e.code() == sycl::errc::build);
267+
assert(std::string(e.what()).find("Parsing of user arguments failed") !=
268+
std::string::npos);
269+
}
270+
};
271+
272+
CheckUnsupported({"-fsanitize=address"});
273+
CheckUnsupported({"-Xsycl-target-frontend", "-fsanitize=address"});
274+
CheckUnsupported({"-Xsycl-target-frontend=spir64", "-fsanitize=address"});
275+
CheckUnsupported({"-Xarch_device", "-fsanitize=address"});
276+
}
277+
242278
void test_esimd() {
243279
namespace syclex = sycl::ext::oneapi::experimental;
244280
using source_kb = sycl::kernel_bundle<sycl::bundle_state::ext_oneapi_source>;
@@ -317,6 +353,7 @@ int main(int argc, char *argv[]) {
317353
#ifdef SYCL_EXT_ONEAPI_KERNEL_COMPILER
318354
test_build_and_run(readingFromCache);
319355
test_error();
356+
test_unsupported_options();
320357

321358
// TODO: jit_compiler is not supporting ESIMD.
322359
// test_esimd();

0 commit comments

Comments
 (0)