forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Defer diagnostics about usage of SEH (intel#11619)
Rather issue an immediate diagnostic about the use of SEH, emit them deferred similar to what is done for C++ exceptions.
- Loading branch information
1 parent
3847c7c
commit 9be40b5
Showing
2 changed files
with
40 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// RUN: %clang_cc1 -fsycl-is-device -internal-isystem %S/Inputs -triple spir64 -aux-triple x86_64 -fms-compatibility %s -verify | ||
// | ||
// This test checks that we issue a diagnostic about the use of SEH | ||
// features only when they are used on the device. | ||
// | ||
#include "sycl.hpp" | ||
|
||
void seh_okay_on_host() { | ||
__try { | ||
} __except(0) { | ||
} | ||
} | ||
|
||
void seh_not_okay_on_device() { | ||
// expected-error@+2 {{SEH '__try' is not supported on this target}} | ||
// expected-error@+1 {{SYCL kernel cannot use exceptions}} | ||
__try { | ||
} __except(0) { | ||
} | ||
} | ||
|
||
void foo() { | ||
sycl::queue q; | ||
|
||
seh_okay_on_host(); | ||
q.submit([&](sycl::handler &h) { | ||
// expected-note@#KernelSingleTaskKernelFuncCall {{called by 'kernel_single_task<kernel_wrapper}} | ||
h.single_task<class kernel_wrapper>( | ||
[=]() { | ||
// expected-note@+1 {{called by 'operator()'}} | ||
seh_not_okay_on_device(); | ||
}); | ||
}); | ||
} |