Skip to content

[BoundsSafety] Rename experimental C++ and Objective-C flags and make them CC1 only #10635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2025
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 6 additions & 6 deletions clang/include/clang/Basic/DiagnosticFrontendKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -383,15 +383,15 @@ def err_bounds_safety_attributes_cannot_be_disabled : Error<
def err_bounds_safety_initializer_out_of_range : Error<
"initializing value is out of valid range">;

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

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

def warn_bounds_safety_relaxed_system_headers_ignored : Warning<
"-fno-bounds-safety-relaxed-system-headers without -fbounds-safety is "
Expand Down
8 changes: 4 additions & 4 deletions clang/include/clang/Basic/DiagnosticGroups.td
Original file line number Diff line number Diff line change
Expand Up @@ -1584,10 +1584,10 @@ def BoundsSafetyInitList : DiagGroup<"bounds-safety-init-list">;
def BoundsAttributesExternArrayCount : DiagGroup<"bounds-attributes-extern-array-count">;
def BoundsAttributesInitSideEffect
: DiagGroup<"bounds-attributes-init-list-side-effect">;
def BoundsAttributesCXXExperimentalIgnored
: DiagGroup<"bounds-attributes-cxx-experimental-ignored">;
def BoundsAttributesObjCExperimentalIgnored
: DiagGroup<"bounds-attributes-objc-experimental-ignored">;
def BoundsSafetyCXXExperimentalIgnored
: DiagGroup<"experimental-bounds-safety-cxx-ignored">;
def BoundsSafetyObjCExperimentalIgnored
: DiagGroup<"experimental-bounds-safety-objc-ignored">;
def BoundsSafetyRelaxedSystemHeadersIgnored
: DiagGroup<"bounds-safety-relaxed-system-headers-ignore">;
def BoundsAttributesImplicitConvSingleToExplicitIndexable :
Expand Down
4 changes: 2 additions & 2 deletions clang/include/clang/Basic/LangOptions.def
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,8 @@ BENIGN_LANGOPT(CheckConstexprFunctionBodies, 1, 1,
LANGOPT(BoundsSafety, 1, 0, "Bounds safety extension for C")
/* TO_UPSTREAM(BoundsSafety) ON*/
LANGOPT(BoundsSafetyAttributes, 1, 0, "Experimental bounds safety attributes")
LANGOPT(BoundsAttributesCXXExperimental, 1, 0, "Experimental bounds attributes for C++")
LANGOPT(BoundsAttributesObjCExperimental, 1, 0, "Experimental bounds attributes for Objective-C")
LANGOPT(BoundsSafetyCXXExperimental, 1, 0, "Experimental bounds attributes for C++")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hnrklssn @patrykstefanski @rapidsna Should we drop the Experimental suffix from the language option? Upstream doesn't seem to do this but I kind of like having the suffix there because it makes it much clearer that this language option is experimental.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no strong opinion in either direction on this one

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me.

LANGOPT(BoundsSafetyObjCExperimental, 1, 0, "Experimental bounds attributes for Objective-C")
LANGOPT(BoundsSafetyRelaxedSystemHeaders, 1, 1,
"Relax bounds safety assignment rules in system headers")
LANGOPT(BoundsSafetyBringUpMissingChecks, 7, clang::LangOptions::getDefaultBoundsSafetyNewChecksMask(),
Expand Down
28 changes: 14 additions & 14 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -1941,20 +1941,20 @@ defm experimental_bounds_safety_attributes : BoolFOption<
PosFlag<SetTrue, [], [ClangOption], "Enable">,
NegFlag<SetFalse, [], [ClangOption], "Disable">,
BothFlags<[], [ClangOption, CC1Option], " experimental attributes">>;
defm bounds_attributes_cxx_experimental : BoolFOption<
"bounds-attributes-cxx-experimental",
LangOpts<"BoundsAttributesCXXExperimental">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Enable">,
NegFlag<SetFalse, [], [ClangOption], "Disable">,
BothFlags<[], [ClangOption, CC1Option],
" experimental bounds attributes for C++">>;
defm bounds_attributes_objc_experimental : BoolFOption<
"bounds-attributes-objc-experimental",
LangOpts<"BoundsAttributesObjCExperimental">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Enable">,
NegFlag<SetFalse, [], [ClangOption], "Disable">,
BothFlags<[], [ClangOption, CC1Option],
" experimental bounds attributes for ObjC">>;
defm bounds_safety_cxx_experimental : BoolFOption<
"experimental-bounds-safety-cxx",
LangOpts<"BoundsSafetyCXXExperimental">, DefaultFalse,
PosFlag<SetTrue, [], [CC1Option], "Enable">,
NegFlag<SetFalse, [], [CC1Option], "Disable">,
BothFlags<[], [CC1Option],
" experimental support for -fbounds-safety for C++">>;
defm bounds_safety_objc_experimental : BoolFOption<
"experimental-bounds-safety-objc",
LangOpts<"BoundsSafetyObjCExperimental">, DefaultFalse,
PosFlag<SetTrue, [], [CC1Option], "Enable">,
NegFlag<SetFalse, [], [CC1Option], "Disable">,
BothFlags<[], [CC1Option],
" experimental support for -fbounds-safety for ObjC">>;
defm bounds_safety_relaxed_system_headers : BoolFOption<
"bounds-safety-relaxed-system-headers",
LangOpts<"BoundsSafetyRelaxedSystemHeaders">, DefaultTrue,
Expand Down
12 changes: 0 additions & 12 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7750,18 +7750,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &Job,
CmdArgs.push_back("-fexperimental-bounds-safety-attributes");
}

if (Args.hasFlag(options::OPT_fbounds_attributes_cxx_experimental,
options::OPT_fno_bounds_attributes_cxx_experimental,
false)) {
CmdArgs.push_back("-fbounds-attributes-cxx-experimental");
}

if (Args.hasFlag(options::OPT_fbounds_attributes_objc_experimental,
options::OPT_fno_bounds_attributes_objc_experimental,
false)) {
CmdArgs.push_back("-fbounds-attributes-objc-experimental");
}

// -fbounds-safety-relaxed-system-headers is on by default
Args.addOptOutFlag(CmdArgs,
options::OPT_fbounds_safety_relaxed_system_headers,
Expand Down
12 changes: 6 additions & 6 deletions clang/lib/Frontend/CompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4590,10 +4590,10 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
SupportsBoundsSafety = true;
break;
case Language::ObjC:
SupportsBoundsSafety = Opts.BoundsAttributesObjCExperimental;
SupportsBoundsSafety = Opts.BoundsSafetyObjCExperimental;
break;
case Language::CXX:
SupportsBoundsSafety = Opts.BoundsAttributesCXXExperimental;
SupportsBoundsSafety = Opts.BoundsSafetyCXXExperimental;
break;
default:
break;
Expand All @@ -4620,11 +4620,11 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
Opts.ExperimentalLateParseAttributes = 1;
}

if (Opts.BoundsAttributesCXXExperimental && !Opts.BoundsSafety)
Diags.Report(diag::warn_bounds_attributes_cxx_experimental_ignored);
if (Opts.BoundsSafetyCXXExperimental && !Opts.BoundsSafety)
Diags.Report(diag::warn_bounds_safety_cxx_experimental_ignored);

if (Opts.BoundsAttributesObjCExperimental && !Opts.BoundsSafety)
Diags.Report(diag::warn_bounds_attributes_objc_experimental_ignored);
if (Opts.BoundsSafetyObjCExperimental && !Opts.BoundsSafety)
Diags.Report(diag::warn_bounds_safety_objc_experimental_ignored);

if (!Opts.BoundsSafetyRelaxedSystemHeaders && !Opts.BoundsSafety)
Diags.Report(diag::warn_bounds_safety_relaxed_system_headers_ignored);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <builtin-function-sys.h>

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

char * __counted_by(len) func(char * __counted_by(len) src_str, int len) {
int len2 = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


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

#include <ptrcheck.h>

Expand Down
2 changes: 1 addition & 1 deletion clang/test/BoundsSafety-legacy-checks/AST/count-attrs.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple x86_64-apple-mac -ast-dump -fbounds-safety %s | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-apple-mac -ast-dump -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental %s | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-apple-mac -ast-dump -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc %s | FileCheck %s
#include <ptrcheck.h>

int *__counted_by(len) frob(int len);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -ast-dump -fbounds-safety -Wno-bounds-safety-init-list %s | FileCheck %s
// RUN: %clang_cc1 -ast-dump -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -Wno-bounds-safety-init-list %s | FileCheck %s
// RUN: %clang_cc1 -ast-dump -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -Wno-bounds-safety-init-list %s | FileCheck %s

#include <ptrcheck.h>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// FileCheck lines automatically generated using make-ast-dump-check-v2.py

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

struct S {
Expand Down
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 -fbounds-attributes-objc-experimental %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

#include <ptrcheck.h>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -ast-dump -fbounds-safety -Wno-bounds-safety-init-list %s | FileCheck %s
// RUN: %clang_cc1 -ast-dump -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -Wno-bounds-safety-init-list %s | FileCheck %s
// RUN: %clang_cc1 -ast-dump -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -Wno-bounds-safety-init-list %s | FileCheck %s

#include <ptrcheck.h>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

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

char funcA(char buf[__counted_by(len)], int len, int len2);
Expand Down
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]+"

// RUN: %clang_cc1 -O2 -fbounds-safety -triple arm64-apple-iphoneos -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -O2 -fbounds-safety -triple arm64-apple-iphoneos -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -O2 -fbounds-safety -triple arm64-apple-iphoneos -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o - | FileCheck %s

int arr[10];

Expand Down
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]+"

// 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 -fbounds-attributes-objc-experimental -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

int arr[10];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

// RUN: %clang_cc1 -O0 -fbounds-safety -triple arm64-apple-iphoneos -emit-llvm %s -o /dev/null
// RUN: %clang_cc1 -O2 -fbounds-safety -triple arm64-apple-iphoneos -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -O0 -fbounds-safety -triple arm64-apple-iphoneos -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o /dev/null
// RUN: %clang_cc1 -O2 -fbounds-safety -triple arm64-apple-iphoneos -x objective-c -fbounds-attributes-objc-experimental -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -O0 -fbounds-safety -triple arm64-apple-iphoneos -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o /dev/null
// RUN: %clang_cc1 -O2 -fbounds-safety -triple arm64-apple-iphoneos -x objective-c -fexperimental-bounds-safety-objc -emit-llvm %s -o - | FileCheck %s

struct __attribute__((packed)) foo {
char x; // field 0
Expand Down
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_

// RUN: %clang_cc1 -O2 -fbounds-safety -emit-llvm -triple arm64e-apple-iphoneos %s -o - | FileCheck %s
// RUN: %clang_cc1 -O2 -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -emit-llvm -triple arm64e-apple-iphoneos %s -o - | FileCheck %s
// RUN: %clang_cc1 -O2 -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -emit-llvm -triple arm64e-apple-iphoneos %s -o - | FileCheck %s

#include <ptrcheck.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


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

#include <ptrcheck.h>
#include "mock-header.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O0
// RUN: %clang_cc1 -O2 -triple arm64-apple-iphoneos -fbounds-safety -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O2
// 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
// 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
// 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
// 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
#include <ptrcheck.h>

// CHECK-O0-LABEL: @foo(
Expand Down
4 changes: 2 additions & 2 deletions clang/test/BoundsSafety-legacy-checks/CodeGen/array-decay.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O0
// RUN: %clang_cc1 -O2 -triple arm64-apple-iphoneos -fbounds-safety -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O2
// 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
// 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
// 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
// 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

// CHECK-O0-LABEL: @foo(
// CHECK-O0: {{.*}}:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

// RUN: %clang_cc1 -O0 -triple x86_64 -fbounds-safety -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK_O0
// RUN: %clang_cc1 -O2 -triple x86_64 -fbounds-safety -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK_O2
// 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
// 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
// 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
// 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
// CHECK_O0-LABEL: @foo(
// CHECK_O0: {{.*}}:
// CHECK_O0: [[ARRAY:%.*]] = alloca [10 x i32], align 16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


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

typedef struct {
Expand Down
4 changes: 2 additions & 2 deletions clang/test/BoundsSafety-legacy-checks/CodeGen/count-return.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

// RUN: %clang_cc1 -O0 -triple x86_64 -fbounds-safety -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O0
// RUN: %clang_cc1 -O2 -triple x86_64 -fbounds-safety -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-O2
// 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
// 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
// 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
// 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
#include <ptrcheck.h>

int *__sized_by(len) alloc(int len);
Expand Down
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: --version 4

// RUN: %clang_cc1 -O2 -triple arm64-apple-iphoneos -fbounds-safety -Wno-bounds-safety-init-list -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -O2 -triple arm64-apple-iphoneos -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -Wno-bounds-safety-init-list -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -O2 -triple arm64-apple-iphoneos -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -Wno-bounds-safety-init-list -emit-llvm %s -o - | FileCheck %s

#include <ptrcheck.h>

Expand Down
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: --version 4

// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -Wno-bounds-safety-init-list -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -Wno-bounds-safety-init-list -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -O0 -triple arm64-apple-iphoneos -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -Wno-bounds-safety-init-list -emit-llvm %s -o - | FileCheck %s

#include <ptrcheck.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


// RUN: %clang_cc1 -O2 -fbounds-safety -triple x86_64 -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -O2 -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -triple x86_64 -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -O2 -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -triple x86_64 -emit-llvm %s -o - | FileCheck %s

#include <ptrcheck.h>

Expand Down
Loading