aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/catch-undef-behavior.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/catch-undef-behavior.cpp')
-rw-r--r--test/CodeGenCXX/catch-undef-behavior.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/CodeGenCXX/catch-undef-behavior.cpp b/test/CodeGenCXX/catch-undef-behavior.cpp
index 044b92be9f..31958a61e3 100644
--- a/test/CodeGenCXX/catch-undef-behavior.cpp
+++ b/test/CodeGenCXX/catch-undef-behavior.cpp
@@ -292,6 +292,13 @@ int flex_array_index(ArrayMembers *p, int n) {
return p->a2[n];
}
+extern int incomplete[];
+// CHECK: @_Z22incomplete_array_index
+int incomplete_array_index(int n) {
+ // CHECK-NOT: call void @__ubsan_handle_out_of_bounds(
+ return incomplete[n];
+}
+
typedef __attribute__((ext_vector_type(4))) int V4I;
// CHECK: @_Z12vector_index
int vector_index(V4I v, int n) {