summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-02-08 18:02:25 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-02-08 18:02:25 +0000
commitc416e64731c8c35dc7a14014a4bcefcd3d8a46c7 (patch)
treec1d5b5c21974ec4a25614b2185cfdd82752d47cf /clang/test
parent346fb4bbcd3a082ee4da7b69dc44b80290204d0e (diff)
downloadbcm5719-llvm-c416e64731c8c35dc7a14014a4bcefcd3d8a46c7.tar.gz
bcm5719-llvm-c416e64731c8c35dc7a14014a4bcefcd3d8a46c7.zip
[OPENMP]Delay emission of the error messages for the exceptions.
Fixed diagnostic emission for the exceptions support in case of the compilation of OpenMP code for the devices. From now on, it uses delayed diagnostics mechanism, previously used for CUDA only. It allow to diagnose not allowed used of exceptions only in functions that are going to be codegen'ed. llvm-svn: 353542
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/OpenMP/nvptx_target_exceptions_messages.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/OpenMP/nvptx_target_exceptions_messages.cpp b/clang/test/OpenMP/nvptx_target_exceptions_messages.cpp
index 15c9522540f..433ba13f73d 100644
--- a/clang/test/OpenMP/nvptx_target_exceptions_messages.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud