Skip to content

Commit f327405

Browse files
authored
[BoundsSafety] Rename experimental C++ and Objective-C flags and make them CC1 only (#10668)
The existing `-fbounds-attributes-cxx-experimental` and `-fbounds-attributes-objc-experimental` flags were previously exposed as driver and CC1 flags. However, given that these modes are highly experimental we don't want to encourage their use so these flags have no been made CC1 only flags. The functionality is still available from the driver by doing `-Xclang <flag name>`. This patch also does a rename of the flags to be prefixed with `experimental-` which upstream prefers. 1. `-fbounds-attributes-cxx-experimental` -> `-fexperimental-bounds-safety-cxx` 2. `-fbounds-attributes-objc-experimental` -> `-fexperimental-bounds-safety-objc`. This patch also renames "bounds attributes" to "bounds safety" for things associated with these flags (e.g. `LangOptions::BoundsSafetyCXXExperimental`). "bounds attributes" is the legacy name that we need to slowly purge from the codebase and this is one small step towards that goal. rdar://149423268 (cherry picked from commit cf995c3) This is a cherry-pick of #10635 . Conflicts: clang/test/BoundsSafety-legacy-checks/AST/SystemHeaders/builtin-function-main.c clang/test/BoundsSafety/AST/builtin-memcpy-count-annotation.c clang/test/BoundsSafety/AST/system-merge-dynamic-bound-attr.c clang/test/BoundsSafety/AST/typedef-function-attrs-late-parsed-call.c clang/test/BoundsSafety/AST/unify-auto.cpp clang/test/BoundsSafety/CodeGen/compound-literal-counted_by-O2.c clang/test/BoundsSafety/CodeGen/compound-literal-sized_by-O2.c clang/test/BoundsSafety/CodeGen/ended_by_locals.c clang/test/BoundsSafety/CodeGen/init-global-indexable-with-null.c clang/test/BoundsSafety/CodeGen/terminated-by-to-indexable-loop-O2.c clang/test/BoundsSafety/Sema/dynamic-count-ptr-null.c clang/test/BoundsSafety/Sema/static-bound-ptr-init.c clang/utils/bounds_safety_fixup_codegen_tests.sh
1 parent cef328c commit f327405

File tree

747 files changed

+949
-953
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

747 files changed

+949
-953
lines changed

clang/include/clang/Basic/DiagnosticFrontendKinds.td

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,15 +377,15 @@ def err_bounds_safety_attributes_cannot_be_disabled : Error<
377377
def err_bounds_safety_initializer_out_of_range : Error<
378378
"initializing value is out of valid range">;
379379

380-
def warn_bounds_attributes_cxx_experimental_ignored : Warning<
381-
"-fbounds-attributes-cxx-experimental without -fbounds-attributes is "
380+
def warn_bounds_safety_cxx_experimental_ignored : Warning<
381+
"-fexperimental-bounds-safety-cxx without -fbounds-safety is "
382382
"ignored">,
383-
InGroup<BoundsAttributesCXXExperimentalIgnored>;
383+
InGroup<BoundsSafetyCXXExperimentalIgnored>;
384384

385-
def warn_bounds_attributes_objc_experimental_ignored : Warning<
386-
"-fbounds-attributes-objc-experimental without -fbounds-attributes is "
385+
def warn_bounds_safety_objc_experimental_ignored : Warning<
386+
"-fexperimental-bounds-safety-objc without -fbounds-safety is "
387387
"ignored">,
388-
InGroup<BoundsAttributesObjCExperimentalIgnored>;
388+
InGroup<BoundsSafetyObjCExperimentalIgnored>;
389389

390390
def warn_bounds_safety_relaxed_system_headers_ignored : Warning<
391391
"-fno-bounds-safety-relaxed-system-headers without -fbounds-safety is "

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,10 +1487,10 @@ def BoundsSafetyInitList : DiagGroup<"bounds-safety-init-list">;
14871487
def BoundsAttributesExternArrayCount : DiagGroup<"bounds-attributes-extern-array-count">;
14881488
def BoundsAttributesInitSideEffect
14891489
: DiagGroup<"bounds-attributes-init-list-side-effect">;
1490-
def BoundsAttributesCXXExperimentalIgnored
1491-
: DiagGroup<"bounds-attributes-cxx-experimental-ignored">;
1492-
def BoundsAttributesObjCExperimentalIgnored
1493-
: DiagGroup<"bounds-attributes-objc-experimental-ignored">;
1490+
def BoundsSafetyCXXExperimentalIgnored
1491+
: DiagGroup<"experimental-bounds-safety-cxx-ignored">;
1492+
def BoundsSafetyObjCExperimentalIgnored
1493+
: DiagGroup<"experimental-bounds-safety-objc-ignored">;
14941494
def BoundsSafetyRelaxedSystemHeadersIgnored
14951495
: DiagGroup<"bounds-safety-relaxed-system-headers-ignore">;
14961496
def BoundsAttributesImplicitConvSingleToExplicitIndexable :

clang/include/clang/Basic/LangOptions.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,8 @@ BENIGN_LANGOPT(CheckConstexprFunctionBodies, 1, 1,
536536
LANGOPT(BoundsSafety, 1, 0, "Bounds safety extension for C")
537537
/* TO_UPSTREAM(BoundsSafety) ON*/
538538
LANGOPT(BoundsSafetyAttributes, 1, 0, "Experimental bounds safety attributes")
539-
LANGOPT(BoundsAttributesCXXExperimental, 1, 0, "Experimental bounds attributes for C++")
540-
LANGOPT(BoundsAttributesObjCExperimental, 1, 0, "Experimental bounds attributes for Objective-C")
539+
LANGOPT(BoundsSafetyCXXExperimental, 1, 0, "Experimental bounds attributes for C++")
540+
LANGOPT(BoundsSafetyObjCExperimental, 1, 0, "Experimental bounds attributes for Objective-C")
541541
LANGOPT(BoundsSafetyRelaxedSystemHeaders, 1, 1,
542542
"Relax bounds safety assignment rules in system headers")
543543
LANGOPT(BoundsSafetyBringUpMissingChecks, 7, clang::LangOptions::getDefaultBoundsSafetyNewChecksMask(),

clang/include/clang/Driver/Options.td

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1971,20 +1971,20 @@ defm experimental_bounds_safety_attributes : BoolFOption<
19711971
PosFlag<SetTrue, [], [ClangOption], "Enable">,
19721972
NegFlag<SetFalse, [], [ClangOption], "Disable">,
19731973
BothFlags<[], [ClangOption, CC1Option], " experimental attributes">>;
1974-
defm bounds_attributes_cxx_experimental : BoolFOption<
1975-
"bounds-attributes-cxx-experimental",
1976-
LangOpts<"BoundsAttributesCXXExperimental">, DefaultFalse,
1977-
PosFlag<SetTrue, [], [ClangOption], "Enable">,
1978-
NegFlag<SetFalse, [], [ClangOption], "Disable">,
1979-
BothFlags<[], [ClangOption, CC1Option],
1980-
" experimental bounds attributes for C++">>;
1981-
defm bounds_attributes_objc_experimental : BoolFOption<
1982-
"bounds-attributes-objc-experimental",
1983-
LangOpts<"BoundsAttributesObjCExperimental">, DefaultFalse,
1984-
PosFlag<SetTrue, [], [ClangOption], "Enable">,
1985-
NegFlag<SetFalse, [], [ClangOption], "Disable">,
1986-
BothFlags<[], [ClangOption, CC1Option],
1987-
" experimental bounds attributes for ObjC">>;
1974+
defm bounds_safety_cxx_experimental : BoolFOption<
1975+
"experimental-bounds-safety-cxx",
1976+
LangOpts<"BoundsSafetyCXXExperimental">, DefaultFalse,
1977+
PosFlag<SetTrue, [], [CC1Option], "Enable">,
1978+
NegFlag<SetFalse, [], [CC1Option], "Disable">,
1979+
BothFlags<[], [CC1Option],
1980+
" experimental support for -fbounds-safety for C++">>;
1981+
defm bounds_safety_objc_experimental : BoolFOption<
1982+
"experimental-bounds-safety-objc",
1983+
LangOpts<"BoundsSafetyObjCExperimental">, DefaultFalse,
1984+
PosFlag<SetTrue, [], [CC1Option], "Enable">,
1985+
NegFlag<SetFalse, [], [CC1Option], "Disable">,
1986+
BothFlags<[], [CC1Option],
1987+
" experimental support for -fbounds-safety for ObjC">>;
19881988
defm bounds_safety_relaxed_system_headers : BoolFOption<
19891989
"bounds-safety-relaxed-system-headers",
19901990
LangOpts<"BoundsSafetyRelaxedSystemHeaders">, DefaultTrue,

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7546,18 +7546,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &Job,
75467546
CmdArgs.push_back("-fexperimental-bounds-safety-attributes");
75477547
}
75487548

7549-
if (Args.hasFlag(options::OPT_fbounds_attributes_cxx_experimental,
7550-
options::OPT_fno_bounds_attributes_cxx_experimental,
7551-
false)) {
7552-
CmdArgs.push_back("-fbounds-attributes-cxx-experimental");
7553-
}
7554-
7555-
if (Args.hasFlag(options::OPT_fbounds_attributes_objc_experimental,
7556-
options::OPT_fno_bounds_attributes_objc_experimental,
7557-
false)) {
7558-
CmdArgs.push_back("-fbounds-attributes-objc-experimental");
7559-
}
7560-
75617549
// -fbounds-safety-relaxed-system-headers is on by default
75627550
Args.addOptOutFlag(CmdArgs,
75637551
options::OPT_fbounds_safety_relaxed_system_headers,

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4429,10 +4429,10 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
44294429
SupportsBoundsSafety = true;
44304430
break;
44314431
case Language::ObjC:
4432-
SupportsBoundsSafety = Opts.BoundsAttributesObjCExperimental;
4432+
SupportsBoundsSafety = Opts.BoundsSafetyObjCExperimental;
44334433
break;
44344434
case Language::CXX:
4435-
SupportsBoundsSafety = Opts.BoundsAttributesCXXExperimental;
4435+
SupportsBoundsSafety = Opts.BoundsSafetyCXXExperimental;
44364436
break;
44374437
default:
44384438
break;
@@ -4459,11 +4459,11 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
44594459
Opts.ExperimentalLateParseAttributes = 1;
44604460
}
44614461

4462-
if (Opts.BoundsAttributesCXXExperimental && !Opts.BoundsSafety)
4463-
Diags.Report(diag::warn_bounds_attributes_cxx_experimental_ignored);
4462+
if (Opts.BoundsSafetyCXXExperimental && !Opts.BoundsSafety)
4463+
Diags.Report(diag::warn_bounds_safety_cxx_experimental_ignored);
44644464

4465-
if (Opts.BoundsAttributesObjCExperimental && !Opts.BoundsSafety)
4466-
Diags.Report(diag::warn_bounds_attributes_objc_experimental_ignored);
4465+
if (Opts.BoundsSafetyObjCExperimental && !Opts.BoundsSafety)
4466+
Diags.Report(diag::warn_bounds_safety_objc_experimental_ignored);
44674467

44684468
if (!Opts.BoundsSafetyRelaxedSystemHeaders && !Opts.BoundsSafety)
44694469
Diags.Report(diag::warn_bounds_safety_relaxed_system_headers_ignored);

clang/test/BoundsSafety-legacy-checks/AST/SystemHeaders/builtin-function-main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <builtin-function-sys.h>
33

44
// RUN: %clang_cc1 -ast-dump -fbounds-safety %s -I %S/../../../BoundsSafety/AST/SystemHeaders/include | FileCheck %s --implicit-check-not "GetBoundExpr {{.+}} 'char *__single'" --implicit-check-not "GetBoundExpr {{.+}} 'char *'"
5-
// RUN: %clang_cc1 -ast-dump -fbounds-safety %s -I %S/../../../BoundsSafety/AST/SystemHeaders/include -x objective-c -fbounds-attributes-objc-experimental | FileCheck %s --implicit-check-not "GetBoundExpr {{.+}} 'char *__single'" --implicit-check-not "GetBoundExpr {{.+}} 'char *'"
5+
// RUN: %clang_cc1 -ast-dump -fbounds-safety %s -I %S/../../../BoundsSafety/AST/SystemHeaders/include -x objective-c -fexperimental-bounds-safety-objc | FileCheck %s --implicit-check-not "GetBoundExpr {{.+}} 'char *__single'" --implicit-check-not "GetBoundExpr {{.+}} 'char *'"
66

77
char * __counted_by(len) func(char * __counted_by(len) src_str, int len) {
88
int len2 = 0;

clang/test/BoundsSafety-legacy-checks/AST/bounds-attributed-in-return-disabled.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
// RUN: %clang_cc1 -fbounds-safety -ast-dump %s 2>&1 | FileCheck %s
5-
// RUN: %clang_cc1 -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -ast-dump %s 2>&1 | FileCheck %s
5+
// RUN: %clang_cc1 -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -ast-dump %s 2>&1 | FileCheck %s
66

77
#include <ptrcheck.h>
88

clang/test/BoundsSafety-legacy-checks/AST/count-attrs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clang_cc1 -triple x86_64-apple-mac -ast-dump -fbounds-safety %s | FileCheck %s
2-
// RUN: %clang_cc1 -triple x86_64-apple-mac -ast-dump -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental %s | FileCheck %s
2+
// RUN: %clang_cc1 -triple x86_64-apple-mac -ast-dump -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc %s | FileCheck %s
33
#include <ptrcheck.h>
44

55
int *__counted_by(len) frob(int len);

clang/test/BoundsSafety-legacy-checks/AST/counted_by_or_null_call.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clang_cc1 -ast-dump -fbounds-safety -Wno-bounds-safety-init-list %s | FileCheck %s
2-
// RUN: %clang_cc1 -ast-dump -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -Wno-bounds-safety-init-list %s | FileCheck %s
2+
// RUN: %clang_cc1 -ast-dump -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -Wno-bounds-safety-init-list %s | FileCheck %s
33

44
#include <ptrcheck.h>
55

clang/test/BoundsSafety-legacy-checks/AST/ended_by_const_param.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// FileCheck lines automatically generated using make-ast-dump-check-v2.py
22

33
// RUN: %clang_cc1 -triple x86_64-apple-mac -ast-dump -fbounds-safety %s 2>&1 | FileCheck %s
4-
// RUN: %clang_cc1 -triple x86_64-apple-mac -ast-dump -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental %s 2>&1 | FileCheck %s
4+
// RUN: %clang_cc1 -triple x86_64-apple-mac -ast-dump -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc %s 2>&1 | FileCheck %s
55
#include <ptrcheck.h>
66

77
struct S {

clang/test/BoundsSafety-legacy-checks/AST/ended_by_returns.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clang_cc1 -ast-dump -fbounds-safety %s 2> /dev/null | FileCheck %s
2-
// RUN: %clang_cc1 -ast-dump -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental %s 2> /dev/null | FileCheck %s
2+
// RUN: %clang_cc1 -ast-dump -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc %s 2> /dev/null | FileCheck %s
33

44
#include <ptrcheck.h>
55

clang/test/BoundsSafety-legacy-checks/AST/sized_by_or_null_call.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clang_cc1 -ast-dump -fbounds-safety -Wno-bounds-safety-init-list %s | FileCheck %s
2-
// RUN: %clang_cc1 -ast-dump -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -Wno-bounds-safety-init-list %s | FileCheck %s
2+
// RUN: %clang_cc1 -ast-dump -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -Wno-bounds-safety-init-list %s | FileCheck %s
33

44
#include <ptrcheck.h>
55

clang/test/BoundsSafety-legacy-checks/AST/unify-function-types.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
// RUN: %clang_cc1 -ast-dump -fbounds-safety -verify=c %s | FileCheck %s
3-
// RUN: %clang_cc1 -x c++ -ast-dump -fbounds-safety -fbounds-attributes-cxx-experimental -verify=cpp %s
3+
// RUN: %clang_cc1 -x c++ -ast-dump -fbounds-safety -fexperimental-bounds-safety-cxx -verify=cpp %s
44
#include <ptrcheck.h>
55

66
char funcA(char buf[__counted_by(len)], int len, int len2);

clang/test/BoundsSafety-legacy-checks/AST/value-dependence.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clang_cc1 -fexperimental-bounds-safety-attributes -ast-dump %s 2>&1 | FileCheck %s --check-prefix=ATTR-ONLY
2-
// RUN: %clang_cc1 -fbounds-safety -fbounds-attributes-cxx-experimental -DBOUNDS_SAFETY -ast-dump %s 2>&1 | FileCheck %s --check-prefix=BOUNDS-CHECK
2+
// RUN: %clang_cc1 -fbounds-safety -fexperimental-bounds-safety-cxx -DBOUNDS_SAFETY -ast-dump %s 2>&1 | FileCheck %s --check-prefix=BOUNDS-CHECK
33

44
#include <ptrcheck.h>
55

clang/test/BoundsSafety-legacy-checks/CodeGen/addr-of-array-elem-O2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// 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]+"
22
// RUN: %clang_cc1 -O2 -fbounds-safety -triple arm64-apple-iphoneos -emit-llvm %s -o - | FileCheck %s
3-
// RUN: %clang_cc1 -O2 -fbounds-safety -triple arm64-apple-iphoneos -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o - | FileCheck %s
3+
// RUN: %clang_cc1 -O2 -fbounds-safety -triple arm64-apple-iphoneos -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o - | FileCheck %s
44

55
int arr[10];
66

clang/test/BoundsSafety-legacy-checks/CodeGen/addr-of-array-elem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// 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]+"
22
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -emit-llvm %s -o - | FileCheck %s
3-
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o - | FileCheck %s
3+
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o - | FileCheck %s
44

55
int arr[10];
66

clang/test/BoundsSafety-legacy-checks/CodeGen/addr-of-packed-struct.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// 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]+"
22
// RUN: %clang_cc1 -O0 -fbounds-safety -triple arm64-apple-iphoneos -emit-llvm %s -o /dev/null
33
// RUN: %clang_cc1 -O2 -fbounds-safety -triple arm64-apple-iphoneos -emit-llvm %s -o - | FileCheck %s
4-
// RUN: %clang_cc1 -O0 -fbounds-safety -triple arm64-apple-iphoneos -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o /dev/null
5-
// RUN: %clang_cc1 -O2 -fbounds-safety -triple arm64-apple-iphoneos -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o - | FileCheck %s
4+
// RUN: %clang_cc1 -O0 -fbounds-safety -triple arm64-apple-iphoneos -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o /dev/null
5+
// RUN: %clang_cc1 -O2 -fbounds-safety -triple arm64-apple-iphoneos -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o - | FileCheck %s
66

77
struct __attribute__((packed)) foo {
88
char x; // field 0

clang/test/BoundsSafety-legacy-checks/CodeGen/addrof-member-to-single-O2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// 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_
22
// RUN: %clang_cc1 -O2 -fbounds-safety -emit-llvm -triple arm64e-apple-iphoneos %s -o - | FileCheck %s
3-
// RUN: %clang_cc1 -O2 -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -emit-llvm -triple arm64e-apple-iphoneos %s -o - | FileCheck %s
3+
// RUN: %clang_cc1 -O2 -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -emit-llvm -triple arm64e-apple-iphoneos %s -o - | FileCheck %s
44

55
#include <ptrcheck.h>
66

clang/test/BoundsSafety-legacy-checks/CodeGen/alloc-sized-calloc/alloc-sized-calloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// 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_
33

44
// RUN: %clang_cc1 -emit-llvm -triple arm64e -fbounds-safety %s -o - | FileCheck %s
5-
// RUN: %clang_cc1 -emit-llvm -triple arm64e -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental %s -o - | FileCheck %s
5+
// RUN: %clang_cc1 -emit-llvm -triple arm64e -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc %s -o - | FileCheck %s
66

77
#include <ptrcheck.h>
88
#include "mock-header.h"

clang/test/BoundsSafety-legacy-checks/CodeGen/array-bound-deref-addrof.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O0
44
// RUN: %clang_cc1 -O2 -triple arm64-apple-iphoneos -fbounds-safety -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O2
5-
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O0
6-
// RUN: %clang_cc1 -O2 -triple arm64-apple-iphoneos -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O2
5+
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O0
6+
// RUN: %clang_cc1 -O2 -triple arm64-apple-iphoneos -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O2
77
#include <ptrcheck.h>
88

99
// CHECK-O0-LABEL: @foo(

clang/test/BoundsSafety-legacy-checks/CodeGen/array-decay.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// 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]+"
22
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O0
33
// RUN: %clang_cc1 -O2 -triple arm64-apple-iphoneos -fbounds-safety -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O2
4-
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O0
5-
// RUN: %clang_cc1 -O2 -triple arm64-apple-iphoneos -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O2
4+
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O0
5+
// RUN: %clang_cc1 -O2 -triple arm64-apple-iphoneos -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O2
66

77
// CHECK-O0-LABEL: @foo(
88
// CHECK-O0: {{.*}}:

clang/test/BoundsSafety-legacy-checks/CodeGen/const-bound-ptr-conversion.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
// RUN: %clang_cc1 -O0 -triple x86_64 -fbounds-safety -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK_O0
44
// RUN: %clang_cc1 -O2 -triple x86_64 -fbounds-safety -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK_O2
5-
// RUN: %clang_cc1 -O0 -triple x86_64 -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK_O0
6-
// RUN: %clang_cc1 -O2 -triple x86_64 -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK_O2
5+
// RUN: %clang_cc1 -O0 -triple x86_64 -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK_O0
6+
// 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
77
// CHECK_O0-LABEL: @foo(
88
// CHECK_O0: {{.*}}:
99
// CHECK_O0: [[ARRAY:%.*]] = alloca [10 x i32], align 16

clang/test/BoundsSafety-legacy-checks/CodeGen/constant-eval-count-static-init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// 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_
22

33
// RUN: %clang_cc1 -triple x86_64 -fbounds-safety -emit-llvm %s -o - | FileCheck %s
4-
// RUN: %clang_cc1 -triple x86_64 -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o - | FileCheck %s
4+
// RUN: %clang_cc1 -triple x86_64 -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o - | FileCheck %s
55
#include <ptrcheck.h>
66

77
typedef struct {

clang/test/BoundsSafety-legacy-checks/CodeGen/count-return.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
// RUN: %clang_cc1 -O0 -triple x86_64 -fbounds-safety -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O0
44
// RUN: %clang_cc1 -O2 -triple x86_64 -fbounds-safety -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O2
5-
// RUN: %clang_cc1 -O0 -triple x86_64 -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O0
6-
// RUN: %clang_cc1 -O2 -triple x86_64 -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O2
5+
// RUN: %clang_cc1 -O0 -triple x86_64 -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O0
6+
// 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
77
#include <ptrcheck.h>
88

99
int *__sized_by(len) alloc(int len);

0 commit comments

Comments
 (0)