aboutsummaryrefslogtreecommitdiff
path: root/test/OpenMP/nvptx_target_exceptions_messages.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/OpenMP/nvptx_target_exceptions_messages.cpp')
-rw-r--r--test/OpenMP/nvptx_target_exceptions_messages.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/OpenMP/nvptx_target_exceptions_messages.cpp b/test/OpenMP/nvptx_target_exceptions_messages.cpp
index 15c9522540..433ba13f73 100644
--- a/test/OpenMP/nvptx_target_exceptions_messages.cpp
+++ b/test/OpenMP/nvptx_target_exceptions_messages.cpp
@@ -68,4 +68,17 @@ int baz2() {
return 2 + baz3();
}
+int baz1() { throw 1; } // expected-error {{cannot use 'throw' with exceptions disabled}}
+
+int foobar1();
+int foobar2();
+
+int (*A)() = &foobar1;
+#pragma omp declare target
+int (*B)() = &foobar2;
+#pragma omp end declare target
+
+int foobar1() { throw 1; }
+int foobar2() { throw 1; } // expected-error {{cannot use 'throw' with exceptions disabled}}
+
#endif // HEADER