summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-2.C
diff options
context:
space:
mode:
Diffstat (limited to 'libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-2.C')
-rw-r--r--libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-2.C14
1 files changed, 14 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-2.C b/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-2.C
new file mode 100644
index 00000000000..26decf60055
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-2.C
@@ -0,0 +1,14 @@
+/* 'std::bad_cast' exception in OpenMP 'target' region, caught. */
+
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -foffload=disable }
+ Offloading compilation not yet supported; see
+ 'target-exceptions-bad_cast-2-offload-sorry-GCN.C',
+ 'target-exceptions-bad_cast-2-offload-sorry-nvptx.C'. */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "../libgomp.oacc-c++/exceptions-bad_cast-2.C"
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ { dg-output {caught 'std::bad_cast'[\r\n]+} } */