1 // RUN: %clang_cc1 -x c++ -triple x86_64-apple-darwin10 -emit-llvm -o - %s -fsanitize=nullability-arg | FileCheck %s -check-prefixes=ITANIUM,ALL
2 // RUN: %clang_cc1 -x c++ -triple x86_64-pc-windows-msvc -emit-llvm -o - %s -fsanitize=nullability-arg | FileCheck %s -check-prefixes=MSVC,ALL
10 void foo1(void (S0::*_Nonnull f
)());
12 // ITANIUM-LABEL: @_ZN10method_ptr5test1Ev(){{.*}} {
13 // ITANIUM: br i1 icmp ne (i64 ptrtoint (ptr @_ZN10method_ptr2S04foo1Ev to i64), i64 0), label %[[CONT:.*]], label %[[FAIL:[^,]*]]
15 // ITANIUM-NEXT: [[FAIL]]:
16 // ITANIUM-NEXT: call void @__ubsan_handle_nullability_arg
18 // MSVC-LABEL: @"?test1@method_ptr@@YAXXZ"(){{.*}} {
19 // MSVC: br i1 true, label %[[CONT:.*]], label %[[FAIL:[^,]*]]
21 // MSVC-NEXT: [[FAIL]]:
22 // MSVC-NEXT: call void @__ubsan_handle_nullability_arg
27 } // namespace method_ptr
35 using member_ptr
= int S0::*;
37 void foo1(member_ptr _Nonnull
);
39 // ITANIUM-LABEL: @_ZN8data_ptr5test1ENS_2S0E(
40 // MSVC-LABEL: @"?test1@data_ptr@@YAXUS0@1@@Z"(
41 // ALL: [[DATA_PTR_CHECK:%.*]] = icmp ne {{.*}}, -1, !nosanitize
42 // ALL-NEXT: br i1 [[DATA_PTR_CHECK]], label %[[CONT:.*]], label %[[FAIL:[^,]+]]
44 // ALL-NEXT: [[FAIL]]:
45 // ALL-NEXT: call void @__ubsan_handle_nullability_arg
47 int S0::*member
= &S0::field1
;
51 } // namespace data_ptr