Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clang/test/BoundsSafety-legacy-checks/AST/ended_by_returns.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -ast-dump -fbounds-safety %s 2> /dev/null | FileCheck %s
// RUN: %clang_cc1 -ast-dump -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc %s 2> /dev/null | FileCheck %s
// RUN: %clang_cc1 -ast-dump -fbounds-safety -Wno-error=incompatible-pointer-types %s 2> /dev/null | FileCheck %s
// RUN: %clang_cc1 -ast-dump -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -Wno-error=incompatible-pointer-types %s 2> /dev/null | FileCheck %s

#include <ptrcheck.h>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// REQUIRES: system-darwin
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --replace-value-regex "!annotation ![0-9]+" "!tbaa ![0-9]+" "!tbaa.struct ![0-9]+" "!nosanitize ![0-9]+" "!srcloc ![0-9]+" --prefix-filecheck-ir-name TMP_

// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -Wno-error=incompatible-pointer-types -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -Wno-error=incompatible-pointer-types -emit-llvm %s -o - | FileCheck %s

#include <ptrcheck.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ char access(struct Outer *bar, int index) {
// CHECK: cont:
// CHECK-NEXT: [[TMP1:%.*]] = icmp ule ptr [[TMP0]], [[AGG_TEMP1_SROA_2_0_COPYLOAD]], !annotation {{![0-9]+}}
// CHECK-NEXT: [[TMP2:%.*]] = icmp ule ptr [[AGG_TEMP1_SROA_3_0_COPYLOAD]], [[AGG_TEMP1_SROA_0_0_COPYLOAD]], !annotation {{![0-9]+}}
// CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[TMP1]], i1 [[TMP2]], i1 false, !annotation {{![0-9]+}}
// CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[TMP1]], i1 [[TMP2]], i1 false, !prof {{![0-9]+}}, !annotation {{![0-9]+}}
// CHECK-NEXT: br i1 [[OR_COND]], label [[CONT18:%.*]], label [[TRAP]], !prof {{![0-9]+}}, !annotation {{![0-9]+}}
// CHECK: cont18:
// CHECK-NEXT: [[FLEX_COUNT_MINUS:%.*]] = icmp sgt i32 [[LEN]], -1, !annotation {{![0-9]+}}
Expand All @@ -71,9 +71,9 @@ char access(struct Outer *bar, int index) {
// CHECK-NEXT: [[FLEX_AVAIL_COUNT:%.*]] = sub nuw i64 [[UPPER_INTPTR]], [[FAM_INTPTR]], !annotation {{![0-9]+}}
// CHECK-NEXT: [[FLEX_COUNT_INTPTR:%.*]] = zext nneg i32 [[LEN]] to i64, !annotation {{![0-9]+}}
// CHECK-NEXT: [[FLEX_COUNT_CHECK:%.*]] = icmp uge i64 [[FLEX_AVAIL_COUNT]], [[FLEX_COUNT_INTPTR]], !annotation {{![0-9]+}}
// CHECK-NEXT: [[OR_COND49:%.*]] = select i1 [[FLEX_COUNT_MINUS]], i1 [[FLEX_COUNT_CHECK]], i1 false, !annotation {{![0-9]+}}
// CHECK-NEXT: [[OR_COND49:%.*]] = select i1 [[FLEX_COUNT_MINUS]], i1 [[FLEX_COUNT_CHECK]], i1 false, !prof {{![0-9]+}}, !annotation {{![0-9]+}}
// CHECK-NEXT: [[TMP3:%.*]] = icmp ult ptr [[AGG_TEMP1_SROA_0_0_COPYLOAD]], [[AGG_TEMP1_SROA_2_0_COPYLOAD]], !annotation {{![0-9]+}}
// CHECK-NEXT: [[OR_COND60:%.*]] = select i1 [[OR_COND49]], i1 [[TMP3]], i1 false, !annotation {{![0-9]+}}
// CHECK-NEXT: [[OR_COND60:%.*]] = select i1 [[OR_COND49]], i1 [[TMP3]], i1 false, !prof {{![0-9]+}}, !annotation {{![0-9]+}}
// CHECK-NEXT: br i1 [[OR_COND60]], label [[BOUNDSCHECK_CONT:%.*]], label [[TRAP]], !prof {{![0-9]+}}, !annotation {{![0-9]+}}
// CHECK: boundscheck.cont.thread:
// CHECK-NEXT: store i32 [[LEN]], ptr inttoptr (i64 4 to ptr), align 4, !tbaa {{![0-9]+}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py


// RUN: %clang_cc1 -O2 -triple x86_64 -fbounds-safety -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O2
// RUN: %clang_cc1 -O2 -triple x86_64 -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O2
// RUN: %clang_cc1 -O2 -triple x86_64 -fbounds-safety -Wno-error=incompatible-pointer-types -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O2
// RUN: %clang_cc1 -O2 -triple x86_64 -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -Wno-error=incompatible-pointer-types -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O2

#include <ptrcheck.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// CHECK-NEXT: [[TMP0:%.*]] = icmp ult ptr [[PTR_COERCE0:%.*]], [[PTR_COERCE1:%.*]], {{!annotation ![0-9]+}}
// CHECK-NEXT: br i1 [[TMP0]], label [[TERMINATED_BY_LOOP_COND:%.*]], label [[TRAP:%.*]], !prof [[PROF3:![0-9]+]], {{!annotation ![0-9]+}}
// CHECK: trap:
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR2:[0-9]+]], {{!annotation ![0-9]+}}
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR3:[0-9]+]], {{!annotation ![0-9]+}}
// CHECK-NEXT: unreachable, {{!annotation ![0-9]+}}
// CHECK: terminated_by.loop_cond:
// CHECK-NEXT: [[TERMINATED_BY_CUR_0:%.*]] = phi ptr [ [[TERMINATED_BY_ONE_PAST_CUR:%.*]], [[CONT2:%.*]] ], [ [[PTR_COERCE0]], [[ENTRY:%.*]] ]
Expand All @@ -37,10 +37,10 @@ int *__null_terminated indexable(int *__indexable ptr) {
// CHECK-NEXT: [[AGG_TEMP1_SROA_3_0_COPYLOAD:%.*]] = load ptr, ptr [[AGG_TEMP1_SROA_3_0_PTR_SROA_IDX]], align 8, {{!tbaa ![0-9]+}}
// CHECK-NEXT: [[DOTNOT:%.*]] = icmp uge ptr [[AGG_TEMP1_SROA_0_0_COPYLOAD]], [[AGG_TEMP1_SROA_3_0_COPYLOAD]], {{!annotation ![0-9]+}}
// CHECK-NEXT: [[TMP0:%.*]] = icmp ult ptr [[AGG_TEMP1_SROA_0_0_COPYLOAD]], [[AGG_TEMP1_SROA_2_0_COPYLOAD]], {{!annotation ![0-9]+}}
// CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[DOTNOT]], i1 [[TMP0]], i1 false, {{!annotation ![0-9]+}}
// CHECK-NEXT: br i1 [[OR_COND]], label [[TERMINATED_BY_LOOP_COND:%.*]], label [[TRAP:%.*]], !prof [[PROF13:![0-9]+]], {{!annotation ![0-9]+}}
// CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[DOTNOT]], i1 [[TMP0]], i1 false, !prof [[PROF13:![0-9]+]], {{!annotation ![0-9]+}}
// CHECK-NEXT: br i1 [[OR_COND]], label [[TERMINATED_BY_LOOP_COND:%.*]], label [[TRAP:%.*]], !prof [[PROF13]], {{!annotation ![0-9]+}}
// CHECK: trap:
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR2]], {{!annotation ![0-9]+}}
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR3]], {{!annotation ![0-9]+}}
// CHECK-NEXT: unreachable, {{!annotation ![0-9]+}}
// CHECK: terminated_by.loop_cond:
// CHECK-NEXT: [[TERMINATED_BY_CUR_0:%.*]] = phi ptr [ [[TERMINATED_BY_ONE_PAST_CUR:%.*]], [[CONT8:%.*]] ], [ [[AGG_TEMP1_SROA_0_0_COPYLOAD]], [[ENTRY:%.*]] ]
Expand All @@ -63,7 +63,7 @@ int *__null_terminated bidi_indexable(int *__bidi_indexable ptr) {
// CHECK-NEXT: [[TMP0:%.*]] = icmp ult ptr [[PTR_COERCE0:%.*]], [[PTR_COERCE1:%.*]], {{!annotation ![0-9]+}}
// CHECK-NEXT: br i1 [[TMP0]], label [[TERMINATED_BY_LOOP_COND:%.*]], label [[TRAP:%.*]], !prof [[PROF3]], {{!annotation ![0-9]+}}
// CHECK: trap:
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR2]], {{!annotation ![0-9]+}}
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR3]], {{!annotation ![0-9]+}}
// CHECK-NEXT: unreachable, {{!annotation ![0-9]+}}
// CHECK: terminated_by.loop_cond:
// CHECK-NEXT: [[TERMINATED_BY_CUR_0:%.*]] = phi ptr [ [[TERMINATED_BY_ONE_PAST_CUR:%.*]], [[CONT2:%.*]] ], [ [[PTR_COERCE0]], [[ENTRY:%.*]] ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ void bar(struct s *p);
// CHECK-NEXT: [[TMP1:%.*]] = getelementptr i8, ptr [[BUF]], i64 4
// CHECK-NEXT: [[DOTNOT:%.*]] = icmp ugt ptr [[BUF]], [[TMP1]], {{!annotation ![0-9]+}}
// CHECK-NEXT: [[DOTNOT49:%.*]] = icmp ugt ptr [[TMP1]], [[ADD_PTR]], {{!annotation ![0-9]+}}
// CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[DOTNOT]], i1 true, i1 [[DOTNOT49]], {{!annotation ![0-9]+}}
// CHECK-NEXT: br i1 [[OR_COND]], label [[TRAP:%.*]], label [[CONT27:%.*]], !prof [[PROF6:![0-9]+]], {{!annotation ![0-9]+}}
// CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[DOTNOT]], i1 true, i1 [[DOTNOT49]], !prof [[PROF6:![0-9]+]], {{!annotation ![0-9]+}}
// CHECK-NEXT: br i1 [[OR_COND]], label [[TRAP:%.*]], label [[CONT27:%.*]], !prof [[PROF6]], {{!annotation ![0-9]+}}
// CHECK: trap:
// CHECK-NEXT: tail call void @llvm.ubsantrap(i8 25) #[[ATTR3:[0-9]+]], {{!annotation ![0-9]+}}
// CHECK-NEXT: unreachable, {{!annotation ![0-9]+}}
Expand Down
5 changes: 2 additions & 3 deletions clang/test/BoundsSafety/AST/bitcast-to-counted_by.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// RUN: %clang_cc1 -fbounds-safety -ast-dump -Wno-bounds-safety-init-list -Wno-error=incompatible-pointer-types %s | FileCheck %s
// RUN: %clang_cc1 -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -ast-dump -Wno-bounds-safety-init-list -Wno-error=incompatible-pointer-types %s | FileCheck %s


// RUN: %clang_cc1 -fbounds-safety -ast-dump -Wno-bounds-safety-init-list %s | FileCheck %s
// RUN: %clang_cc1 -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -ast-dump -Wno-bounds-safety-init-list %s | FileCheck %s
#include <ptrcheck.h>

void Test(void) {
Expand Down
10 changes: 4 additions & 6 deletions clang/test/BoundsSafety/AST/const-cast.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@


// RUN: %clang_cc1 -ast-dump -fbounds-safety -Wno-incompatible-pointer-types %s 2>&1 | FileCheck %s
// RUN: %clang_cc1 -emit-llvm -fbounds-safety %s -o /dev/null
// RUN: %clang_cc1 -emit-llvm -fbounds-safety -O2 %s -o /dev/null
// RUN: %clang_cc1 -emit-llvm -fbounds-safety -Wno-error=incompatible-pointer-types %s -o /dev/null
// RUN: %clang_cc1 -emit-llvm -fbounds-safety -Wno-error=incompatible-pointer-types -O2 %s -o /dev/null

// RUN: %clang_cc1 -ast-dump -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -Wno-incompatible-pointer-types %s 2>&1 | FileCheck %s
// RUN: %clang_cc1 -emit-llvm -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc %s -o /dev/null
// RUN: %clang_cc1 -emit-llvm -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -O2 %s -o /dev/null
// RUN: %clang_cc1 -emit-llvm -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -Wno-error=incompatible-pointer-types %s -o /dev/null
// RUN: %clang_cc1 -emit-llvm -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -Wno-error=incompatible-pointer-types -O2 %s -o /dev/null

#include <ptrcheck.h>

Expand Down
3 changes: 1 addition & 2 deletions clang/test/BoundsSafety/AST/ended_by_assign_checks.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

// RUN: %clang_cc1 -ast-dump -fbounds-safety %s 2> /dev/null | FileCheck %s
// RUN: %clang_cc1 -ast-dump -fbounds-safety -Wno-error=incompatible-pointer-types %s 2> /dev/null | FileCheck %s

#include <ptrcheck.h>

Expand Down
5 changes: 2 additions & 3 deletions clang/test/BoundsSafety/AST/ended_by_returns.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

// RUN: %clang_cc1 -ast-dump -fbounds-safety %s 2> /dev/null | FileCheck %s
// RUN: %clang_cc1 -ast-dump -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc %s 2> /dev/null | FileCheck %s
// RUN: %clang_cc1 -ast-dump -fbounds-safety -Wno-error=incompatible-pointer-types %s 2> /dev/null | FileCheck %s
// RUN: %clang_cc1 -ast-dump -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -Wno-error=incompatible-pointer-types %s 2> /dev/null | FileCheck %s

#include <ptrcheck.h>

Expand Down
6 changes: 2 additions & 4 deletions clang/test/BoundsSafety/AST/forward-declared-type.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@


// RUN: %clang_cc1 -ast-dump -verify -fbounds-safety %s 2>&1 | FileCheck %s
// RUN: %clang_cc1 -x objective-c -ast-dump -verify -fbounds-safety -fexperimental-bounds-safety-objc %s 2>&1 | FileCheck %s
// RUN: %clang_cc1 -ast-dump -verify -fbounds-safety -Wno-error=incompatible-pointer-types %s 2>&1 | FileCheck %s
// RUN: %clang_cc1 -x objective-c -ast-dump -verify -fbounds-safety -fexperimental-bounds-safety-objc -Wno-error=incompatible-pointer-types %s 2>&1 | FileCheck %s

#include <ptrcheck.h>

Expand Down
8 changes: 4 additions & 4 deletions clang/test/BoundsSafety/CodeGen/addr-of-struct-field.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// RUN: %clang_cc1 -O0 -fbounds-safety -Wno-error=incompatible-pointer-types -emit-llvm %s -o /dev/null
// RUN: %clang_cc1 -O2 -fbounds-safety -Wno-error=incompatible-pointer-types -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -O0 -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -Wno-error=incompatible-pointer-types -emit-llvm %s -o /dev/null
// RUN: %clang_cc1 -O2 -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -Wno-error=incompatible-pointer-types -emit-llvm %s -o - | FileCheck %s

// RUN: %clang_cc1 -O0 -fbounds-safety -emit-llvm %s -o /dev/null
// RUN: %clang_cc1 -O2 -fbounds-safety -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -O0 -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o /dev/null
// RUN: %clang_cc1 -O2 -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o - | FileCheck %s
struct S {
int i;
char *p;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

// RUN: %clang_cc1 -S -fbounds-safety -triple arm64-apple-darwin -O0 %s -o - | FileCheck %s
// RUN: %clang_cc1 -S -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -triple arm64-apple-darwin -O0 %s -o - | FileCheck %s
// RUN: %clang_cc1 -S -fbounds-safety -Wno-error=incompatible-pointer-types -triple arm64-apple-darwin -O0 %s -o - | FileCheck %s
// RUN: %clang_cc1 -S -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -Wno-error=incompatible-pointer-types -triple arm64-apple-darwin -O0 %s -o - | FileCheck %s

#include <ptrcheck.h>

Expand Down
4 changes: 2 additions & 2 deletions clang/test/BoundsSafety/CodeGen/ended_by_returns.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --replace-value-regex "!annotation ![0-9]+" "!tbaa ![0-9]+" "!tbaa.struct ![0-9]+" "!nosanitize ![0-9]+" "!srcloc ![0-9]+" --prefix-filecheck-ir-name TMP_ --version 5
// REQUIRES: system-darwin
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -Wno-error=incompatible-pointer-types -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -Wno-error=incompatible-pointer-types -emit-llvm %s -o - | FileCheck %s

#include <ptrcheck.h>

Expand Down
Loading