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: [[CMP:%.*]] = icmp ne i64 ptrtoint (ptr @_ZN10method_ptr2S04foo1Ev to i64), 0
14 // ITANIUM: br i1 [[CMP]], label %[[CONT:.*]], label %[[FAIL:[^,]*]]
16 // ITANIUM-NEXT: [[FAIL]]:
17 // ITANIUM-NEXT: call void @__ubsan_handle_nullability_arg
19 // MSVC-LABEL: @"?test1@method_ptr@@YAXXZ"(){{.*}} {
20 // MSVC: br i1 true, label %[[CONT:.*]], label %[[FAIL:[^,]*]]
22 // MSVC-NEXT: [[FAIL]]:
23 // MSVC-NEXT: call void @__ubsan_handle_nullability_arg
28 } // namespace method_ptr
36 using member_ptr
= int S0::*;
38 void foo1(member_ptr _Nonnull
);
40 // ITANIUM-LABEL: @_ZN8data_ptr5test1ENS_2S0E(
41 // MSVC-LABEL: @"?test1@data_ptr@@YAXUS0@1@@Z"(
42 // ALL: [[DATA_PTR_CHECK:%.*]] = icmp ne {{.*}}, -1, !nosanitize
43 // ALL-NEXT: br i1 [[DATA_PTR_CHECK]], label %[[CONT:.*]], label %[[FAIL:[^,]+]]
45 // ALL-NEXT: [[FAIL]]:
46 // ALL-NEXT: call void @__ubsan_handle_nullability_arg
48 int S0::*member
= &S0::field1
;
52 } // namespace data_ptr