[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / CodeGenObjC / ubsan-check-debuglocs.m
blobd85c8e83e11a221a585dfdfcd2bd1f5573abbb5f
1 // RUN: %clang_cc1 -emit-llvm -fblocks -debug-info-kind=limited \
2 // RUN:   -fsanitize=nullability-return %s -o - | FileCheck %s
4 // Check that santizer check calls have a !dbg location.
5 // CHECK: call void {{.*}}@__ubsan_handle_nullability_return_v1_abort
6 // CHECK-SAME: !dbg
8 @protocol NSObject
9 @end
11 @interface NSObject<NSObject> {}
12 @end
14 #pragma clang assume_nonnull begin
15 @interface NSString : NSObject
16 + (instancetype)stringWithFormat:(NSString *)format, ...;
17 @end
19 @interface NSIndexPath : NSObject {}
20 @end
21 #pragma clang assume_nonnull end
23 @interface B : NSObject
24 @end
25 id foo(NSIndexPath *indexPath) {
26   return [B withBlock:^{
27     return [NSString stringWithFormat:@"%ld",
28                                       (long)[indexPath indexAtPosition:1]];
29   }];