aboutsummaryrefslogtreecommitdiff
path: root/test/ubsan/TestCases/Misc/unreachable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/ubsan/TestCases/Misc/unreachable.cpp')
-rw-r--r--test/ubsan/TestCases/Misc/unreachable.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ubsan/TestCases/Misc/unreachable.cpp b/test/ubsan/TestCases/Misc/unreachable.cpp
new file mode 100644
index 000000000000..e1206edb30d5
--- /dev/null
+++ b/test/ubsan/TestCases/Misc/unreachable.cpp
@@ -0,0 +1,6 @@
+// RUN: %clangxx -fsanitize=unreachable %s -O3 -o %t && not %run %t 2>&1 | FileCheck %s
+
+int main(int, char **argv) {
+ // CHECK: unreachable.cpp:5:3: runtime error: execution reached a __builtin_unreachable() call
+ __builtin_unreachable();
+}