aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/ubsan-suppress-checks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/ubsan-suppress-checks.cpp')
-rw-r--r--test/CodeGenCXX/ubsan-suppress-checks.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGenCXX/ubsan-suppress-checks.cpp b/test/CodeGenCXX/ubsan-suppress-checks.cpp
index ae7c94b34f290..fa7ea29d94f20 100644
--- a/test/CodeGenCXX/ubsan-suppress-checks.cpp
+++ b/test/CodeGenCXX/ubsan-suppress-checks.cpp
@@ -17,6 +17,17 @@ void load_non_null_pointers() {
// CHECK: ret void
}
+// CHECK-LABEL: define void @_Z31use_us16_aligned_array_elementsv
+void use_us16_aligned_array_elements() {
+ static const unsigned short Arr[] = {0, 1, 2};
+ auto use_array = [](const unsigned short(&X)[3]) -> void {};
+ use_array(Arr);
+
+ // CHECK-NOT: br i1 true
+ // ALIGN-NOT: call void @__ubsan_handle_type_mismatch
+ // CHECK: ret void
+}
+
struct A {
int foo;
@@ -229,4 +240,5 @@ void force_irgen() {
d->load_member_3();
load_non_null_pointers();
+ use_us16_aligned_array_elements();
}