xref: /llvm-project/clang/test/CodeGenObjC/ubsan-array-bounds.m (revision f764dc99b37e1e6428724a61f36bcb49c015dc70)
1// RUN: %clang_cc1 -x objective-c -emit-llvm -triple x86_64-apple-macosx10.10.0 -Wno-objc-root-class -fsanitize=array-bounds %s -o - | FileCheck %s
2
3@interface FlexibleArray1 {
4@public
5  char chars[0];
6}
7@end
8@implementation FlexibleArray1
9@end
10
11// CHECK-LABEL: test_FlexibleArray1
12char test_FlexibleArray1(FlexibleArray1 *FA1) {
13  // CHECK-NOT: !nosanitize
14  return FA1->chars[1];
15  // CHECK: }
16}
17