aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGenObjC/ubsan-array-bounds.m
blob: ebb7517adca98bd73d01f55b608a900f96137c53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// 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

@interface FlexibleArray1 {
@public
  char chars[0];
}
@end
@implementation FlexibleArray1
@end

// CHECK-LABEL: test_FlexibleArray1
char test_FlexibleArray1(FlexibleArray1 *FA1) {
  // CHECK-NOT: !nosanitize
  return FA1->chars[1];
  // CHECK: }
}