1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -w -emit-llvm -o - %s -fsanitize=pointer-overflow | FileCheck %s
3 // CHECK-LABEL: define{{.*}} void @variable_len_array_arith
4 void variable_len_array_arith(int n, int k) {
8 // CHECK: getelementptr inbounds i32, ptr {{.*}}, i64 [[INC:%.*]]
9 // CHECK: @llvm.smul.with.overflow.i64(i64 4, i64 [[INC]]), !nosanitize
11 // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
14 // CHECK: getelementptr inbounds i32, ptr {{.*}}, i64 [[IDXPROM:%.*]]
15 // CHECK: @llvm.smul.with.overflow.i64(i64 4, i64 [[IDXPROM]]), !nosanitize
17 // CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
21 // CHECK-LABEL: define{{.*}} void @objc_id
23 // CHECK: add i64 {{.*}}, 8, !nosanitize
25 // CHECK: @__ubsan_handle_pointer_overflow{{.*}}