diff --git a/clang/test/AST/attr-counted-by-or-null-struct-ptrs.c b/clang/test/AST/attr-counted-by-or-null-struct-ptrs.c index cedb3f1192ed..075f583784fe 100644 --- a/clang/test/AST/attr-counted-by-or-null-struct-ptrs.c +++ b/clang/test/AST/attr-counted-by-or-null-struct-ptrs.c @@ -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))) diff --git a/clang/test/AST/attr-counted-by-struct-ptrs.c b/clang/test/AST/attr-counted-by-struct-ptrs.c index 79a453d239cd..0c0525823414 100644 --- a/clang/test/AST/attr-counted-by-struct-ptrs.c +++ b/clang/test/AST/attr-counted-by-struct-ptrs.c @@ -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))) diff --git a/clang/test/AST/attr-sized-by-or-null-struct-ptrs.c b/clang/test/AST/attr-sized-by-or-null-struct-ptrs.c index 6189799b85cc..73b8a71f2350 100644 --- a/clang/test/AST/attr-sized-by-or-null-struct-ptrs.c +++ b/clang/test/AST/attr-sized-by-or-null-struct-ptrs.c @@ -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))) diff --git a/clang/test/AST/attr-sized-by-struct-ptrs.c b/clang/test/AST/attr-sized-by-struct-ptrs.c index 5d9ed0094c68..7f7e3dfea2ac 100644 --- a/clang/test/AST/attr-sized-by-struct-ptrs.c +++ b/clang/test/AST/attr-sized-by-struct-ptrs.c @@ -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))) diff --git a/clang/test/Sema/attr-counted-by-bounds-safety-vlas.c b/clang/test/Sema/attr-counted-by-bounds-safety-vlas.c index 7d9c9a90880f..5a739f9c6bc0 100644 --- a/clang/test/Sema/attr-counted-by-bounds-safety-vlas.c +++ b/clang/test/Sema/attr-counted-by-bounds-safety-vlas.c @@ -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 diff --git a/clang/test/Sema/attr-counted-by-or-null-last-field.c b/clang/test/Sema/attr-counted-by-or-null-last-field.c index dd3a6422521c..12c0b6de44f7 100644 --- a/clang/test/Sema/attr-counted-by-or-null-last-field.c +++ b/clang/test/Sema/attr-counted-by-or-null-last-field.c @@ -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))) @@ -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 { diff --git a/clang/test/Sema/attr-counted-by-or-null-struct-ptrs-sizeless-types.c b/clang/test/Sema/attr-counted-by-or-null-struct-ptrs-sizeless-types.c index 301977300b06..4b898e7369c1 100644 --- a/clang/test/Sema/attr-counted-by-or-null-struct-ptrs-sizeless-types.c +++ b/clang/test/Sema/attr-counted-by-or-null-struct-ptrs-sizeless-types.c @@ -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))) diff --git a/clang/test/Sema/attr-counted-by-or-null-struct-ptrs.c b/clang/test/Sema/attr-counted-by-or-null-struct-ptrs.c index 017aafe0c939..708bb727ce09 100644 --- a/clang/test/Sema/attr-counted-by-or-null-struct-ptrs.c +++ b/clang/test/Sema/attr-counted-by-or-null-struct-ptrs.c @@ -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))) diff --git a/clang/test/Sema/attr-counted-by-or-null-vla-sizeless-types.c b/clang/test/Sema/attr-counted-by-or-null-vla-sizeless-types.c index 8abd4476fe59..1e8c7179e790 100644 --- a/clang/test/Sema/attr-counted-by-or-null-vla-sizeless-types.c +++ b/clang/test/Sema/attr-counted-by-or-null-vla-sizeless-types.c @@ -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))) diff --git a/clang/test/Sema/attr-counted-by-struct-ptrs-sizeless-types.c b/clang/test/Sema/attr-counted-by-struct-ptrs-sizeless-types.c index 9b0f2eafb13c..1de93640cf45 100644 --- a/clang/test/Sema/attr-counted-by-struct-ptrs-sizeless-types.c +++ b/clang/test/Sema/attr-counted-by-struct-ptrs-sizeless-types.c @@ -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))) diff --git a/clang/test/Sema/attr-counted-by-struct-ptrs.c b/clang/test/Sema/attr-counted-by-struct-ptrs.c index cd2bfe36938b..321d6aafbeba 100644 --- a/clang/test/Sema/attr-counted-by-struct-ptrs.c +++ b/clang/test/Sema/attr-counted-by-struct-ptrs.c @@ -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))) diff --git a/clang/test/Sema/attr-counted-by-vla-sizeless-types.c b/clang/test/Sema/attr-counted-by-vla-sizeless-types.c index 31c0007501c4..8cc5f6448254 100644 --- a/clang/test/Sema/attr-counted-by-vla-sizeless-types.c +++ b/clang/test/Sema/attr-counted-by-vla-sizeless-types.c @@ -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))) diff --git a/clang/test/Sema/attr-counted-by-vla.c b/clang/test/Sema/attr-counted-by-vla.c index 571d6e6291e6..35737c03f322 100644 --- a/clang/test/Sema/attr-counted-by-vla.c +++ b/clang/test/Sema/attr-counted-by-vla.c @@ -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))) @@ -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 { diff --git a/clang/test/Sema/attr-sized-by-last-field.c b/clang/test/Sema/attr-sized-by-last-field.c index 6af29e9f3143..f2e74f7fdf4b 100644 --- a/clang/test/Sema/attr-sized-by-last-field.c +++ b/clang/test/Sema/attr-sized-by-last-field.c @@ -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))) @@ -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 { diff --git a/clang/test/Sema/attr-sized-by-or-null-last-field.c b/clang/test/Sema/attr-sized-by-or-null-last-field.c index 96bbe847b910..08ef5263a05c 100644 --- a/clang/test/Sema/attr-sized-by-or-null-last-field.c +++ b/clang/test/Sema/attr-sized-by-or-null-last-field.c @@ -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))) @@ -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 { diff --git a/clang/test/Sema/attr-sized-by-or-null-struct-ptrs-sizeless-types.c b/clang/test/Sema/attr-sized-by-or-null-struct-ptrs-sizeless-types.c index 4a360b9722a0..d960c0d31b65 100644 --- a/clang/test/Sema/attr-sized-by-or-null-struct-ptrs-sizeless-types.c +++ b/clang/test/Sema/attr-sized-by-or-null-struct-ptrs-sizeless-types.c @@ -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))) diff --git a/clang/test/Sema/attr-sized-by-or-null-struct-ptrs.c b/clang/test/Sema/attr-sized-by-or-null-struct-ptrs.c index 2c7578b5ecbe..4200c9275a18 100644 --- a/clang/test/Sema/attr-sized-by-or-null-struct-ptrs.c +++ b/clang/test/Sema/attr-sized-by-or-null-struct-ptrs.c @@ -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))) diff --git a/clang/test/Sema/attr-sized-by-or-null-vla-sizeless-types.c b/clang/test/Sema/attr-sized-by-or-null-vla-sizeless-types.c index 398b1df592fe..7d16c2d456a0 100644 --- a/clang/test/Sema/attr-sized-by-or-null-vla-sizeless-types.c +++ b/clang/test/Sema/attr-sized-by-or-null-vla-sizeless-types.c @@ -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))) diff --git a/clang/test/Sema/attr-sized-by-struct-ptrs-sizeless-types.c b/clang/test/Sema/attr-sized-by-struct-ptrs-sizeless-types.c index 2e916bdb0472..7038330e60ee 100644 --- a/clang/test/Sema/attr-sized-by-struct-ptrs-sizeless-types.c +++ b/clang/test/Sema/attr-sized-by-struct-ptrs-sizeless-types.c @@ -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))) diff --git a/clang/test/Sema/attr-sized-by-struct-ptrs.c b/clang/test/Sema/attr-sized-by-struct-ptrs.c index 01195469c6fe..07373b247d0f 100644 --- a/clang/test/Sema/attr-sized-by-struct-ptrs.c +++ b/clang/test/Sema/attr-sized-by-struct-ptrs.c @@ -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))) diff --git a/clang/test/Sema/attr-sized-by-vla-sizeless-types.c b/clang/test/Sema/attr-sized-by-vla-sizeless-types.c index 37e91639bb4a..8a94b1217c90 100644 --- a/clang/test/Sema/attr-sized-by-vla-sizeless-types.c +++ b/clang/test/Sema/attr-sized-by-vla-sizeless-types.c @@ -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)))