Skip to content

[Bounds Safety][NFC] Add some missing coverage for -fexperimental-late-parse-attributes #102236

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
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
1 change: 1 addition & 0 deletions clang/test/AST/attr-counted-by-or-null-struct-ptrs.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 %s -ast-dump | FileCheck %s
// RUN: %clang_cc1 -fexperimental-late-parse-attributes %s -ast-dump | FileCheck %s

#define __counted_by_or_null(f) __attribute__((counted_by_or_null(f)))

Expand Down
1 change: 1 addition & 0 deletions clang/test/AST/attr-counted-by-struct-ptrs.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 %s -ast-dump | FileCheck %s
// RUN: %clang_cc1 -fexperimental-late-parse-attributes %s -ast-dump | FileCheck %s

#define __counted_by(f) __attribute__((counted_by(f)))

Expand Down
1 change: 1 addition & 0 deletions clang/test/AST/attr-sized-by-or-null-struct-ptrs.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 %s -ast-dump | FileCheck %s
// RUN: %clang_cc1 -fexperimental-late-parse-attributes %s -ast-dump | FileCheck %s

#define __sized_by_or_null(f) __attribute__((sized_by_or_null(f)))

Expand Down
1 change: 1 addition & 0 deletions clang/test/AST/attr-sized-by-struct-ptrs.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 %s -ast-dump | FileCheck %s
// RUN: %clang_cc1 -fexperimental-late-parse-attributes %s -ast-dump | FileCheck %s

#define __sized_by(f) __attribute__((sized_by(f)))

Expand Down
1 change: 1 addition & 0 deletions clang/test/Sema/attr-counted-by-bounds-safety-vlas.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -fexperimental-bounds-safety -verify %s
// RUN: %clang_cc1 -fsyntax-only -fexperimental-bounds-safety -fexperimental-late-parse-attributes -verify %s
//
// This is a portion of the `attr-counted-by-vla.c` test but is checked
// under the semantics of `-fexperimental-bounds-safety` which has different
Expand Down
7 changes: 5 additions & 2 deletions clang/test/Sema/attr-counted-by-or-null-last-field.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsyntax-only -verify=expected,immediate %s
// RUN: %clang_cc1 -fsyntax-only -fexperimental-late-parse-attributes -verify=expected,late %s

#define __counted_by_or_null(f) __attribute__((counted_by_or_null(f)))

Expand Down Expand Up @@ -82,7 +83,9 @@ struct found_outside_of_struct {

struct self_referrential {
int bork;
struct bar *self[] __counted_by_or_null(self); // expected-error {{use of undeclared identifier 'self'}}
// immediate-error@+2{{use of undeclared identifier 'self'}}
// late-error@+1{{'counted_by_or_null' only applies to pointers; did you mean to use 'counted_by'?}}
struct bar *self[] __counted_by_or_null(self);
};

struct non_int_count {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// __SVInt8_t is specific to ARM64 so specify that in the target triple
// RUN: %clang_cc1 -triple arm64-apple-darwin -fsyntax-only -verify %s
// RUN: %clang_cc1 -fexperimental-late-parse-attributes -triple arm64-apple-darwin -fsyntax-only -verify %s

#define __counted_by_or_null(f) __attribute__((counted_by_or_null(f)))

Expand Down
1 change: 1 addition & 0 deletions clang/test/Sema/attr-counted-by-or-null-struct-ptrs.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify %s

#define __counted_by_or_null(f) __attribute__((counted_by_or_null(f)))
#define __counted_by(f) __attribute__((counted_by(f)))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// __SVInt8_t is specific to ARM64 so specify that in the target triple
// RUN: %clang_cc1 -triple arm64-apple-darwin -fsyntax-only -verify %s
// RUN: %clang_cc1 -fexperimental-late-parse-attributes -triple arm64-apple-darwin -fsyntax-only -verify %s

#define __counted_by_or_null(f) __attribute__((counted_by_or_null(f)))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// __SVInt8_t is specific to ARM64 so specify that in the target triple
// RUN: %clang_cc1 -triple arm64-apple-darwin -fsyntax-only -verify %s
// RUN: %clang_cc1 -fexperimental-late-parse-attributes -triple arm64-apple-darwin -fsyntax-only -verify %s

#define __counted_by(f) __attribute__((counted_by(f)))

Expand Down
1 change: 1 addition & 0 deletions clang/test/Sema/attr-counted-by-struct-ptrs.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsyntax-only -fexperimental-late-parse-attributes %s -verify

#define __counted_by(f) __attribute__((counted_by(f)))

Expand Down
1 change: 1 addition & 0 deletions clang/test/Sema/attr-counted-by-vla-sizeless-types.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// __SVInt8_t is specific to ARM64 so specify that in the target triple
// RUN: %clang_cc1 -triple arm64-apple-darwin -fsyntax-only -verify %s
// RUN: %clang_cc1 -triple arm64-apple-darwin -fexperimental-late-parse-attributes -fsyntax-only -verify %s

#define __counted_by(f) __attribute__((counted_by(f)))

Expand Down
7 changes: 5 additions & 2 deletions clang/test/Sema/attr-counted-by-vla.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsyntax-only -verify=expected,immediate %s
// RUN: %clang_cc1 -fsyntax-only -fexperimental-late-parse-attributes %s -verify=expected,late

#define __counted_by(f) __attribute__((counted_by(f)))

Expand Down Expand Up @@ -80,7 +81,9 @@ struct found_outside_of_struct {

struct self_referrential {
int bork;
struct bar *self[] __counted_by(self); // expected-error {{use of undeclared identifier 'self'}}
// immediate-error@+2{{use of undeclared identifier 'self'}}
// late-error@+1{{'counted_by' requires a non-boolean integer type argument}}
struct bar *self[] __counted_by(self);
};

struct non_int_count {
Expand Down
7 changes: 5 additions & 2 deletions clang/test/Sema/attr-sized-by-last-field.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsyntax-only -verify=expected,immediate %s
// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify=expected,late %s

#define __sized_by(f) __attribute__((sized_by(f)))

Expand Down Expand Up @@ -82,7 +83,9 @@ struct found_outside_of_struct {

struct self_referrential {
int bork;
struct bar *self[] __sized_by(self); // expected-error {{use of undeclared identifier 'self'}}
// immediate-error@+2{{use of undeclared identifier 'self'}}
// late-error@+1{{'sized_by' only applies to pointers; did you mean to use 'counted_by'?}}
struct bar *self[] __sized_by(self);
};

struct non_int_size {
Expand Down
7 changes: 5 additions & 2 deletions clang/test/Sema/attr-sized-by-or-null-last-field.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsyntax-only -verify=expected,immediate %s
// RUN: %clang_cc1 -fsyntax-only -fexperimental-late-parse-attributes -verify=expected,late %s

#define __sized_by_or_null(f) __attribute__((sized_by_or_null(f)))

Expand Down Expand Up @@ -82,7 +83,9 @@ struct found_outside_of_struct {

struct self_referrential {
int bork;
struct bar *self[] __sized_by_or_null(self); // expected-error {{use of undeclared identifier 'self'}}
// immediate-error@+2{{use of undeclared identifier 'self'}}
// late-error@+1{{'sized_by_or_null' only applies to pointers; did you mean to use 'counted_by'?}}
struct bar *self[] __sized_by_or_null(self);
};

struct non_int_size {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// __SVInt8_t is specific to ARM64 so specify that in the target triple
// RUN: %clang_cc1 -triple arm64-apple-darwin -fsyntax-only -verify %s
// RUN: %clang_cc1 -fexperimental-late-parse-attributes -triple arm64-apple-darwin -fsyntax-only -verify %s

#define __sized_by_or_null(f) __attribute__((sized_by_or_null(f)))

Expand Down
1 change: 1 addition & 0 deletions clang/test/Sema/attr-sized-by-or-null-struct-ptrs.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify %s

#define __sized_by_or_null(f) __attribute__((sized_by_or_null(f)))
#define __counted_by(f) __attribute__((counted_by(f)))
Expand Down
1 change: 1 addition & 0 deletions clang/test/Sema/attr-sized-by-or-null-vla-sizeless-types.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// __SVInt8_t is specific to ARM64 so specify that in the target triple
// RUN: %clang_cc1 -triple arm64-apple-darwin -fsyntax-only -verify %s
// RUN: %clang_cc1 -fexperimental-late-parse-attributes -triple arm64-apple-darwin -fsyntax-only -verify %s

#define __sized_by_or_null(f) __attribute__((sized_by_or_null(f)))

Expand Down
1 change: 1 addition & 0 deletions clang/test/Sema/attr-sized-by-struct-ptrs-sizeless-types.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// __SVInt8_t is specific to ARM64 so specify that in the target triple
// RUN: %clang_cc1 -triple arm64-apple-darwin -fsyntax-only -verify %s
// RUN: %clang_cc1 -fexperimental-late-parse-attributes -triple arm64-apple-darwin -fsyntax-only -verify %s

#define __sized_by(f) __attribute__((sized_by(f)))

Expand Down
1 change: 1 addition & 0 deletions clang/test/Sema/attr-sized-by-struct-ptrs.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -fexperimental-late-parse-attributes -fsyntax-only -verify %s

#define __sized_by(f) __attribute__((sized_by(f)))
#define __counted_by(f) __attribute__((counted_by(f)))
Expand Down
1 change: 1 addition & 0 deletions clang/test/Sema/attr-sized-by-vla-sizeless-types.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// __SVInt8_t is specific to ARM64 so specify that in the target triple
// RUN: %clang_cc1 -triple arm64-apple-darwin -fsyntax-only -verify %s
// RUN: %clang_cc1 -fexperimental-late-parse-attributes -triple arm64-apple-darwin -fsyntax-only -verify %s

#define __sized_by(f) __attribute__((sized_by(f)))

Expand Down
Loading