Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / Sema / attr-counted-by-late-parsed-off.c
blob34f51d10c083899eca9bb7adb7631b1f8b5efc1f
1 // RUN: %clang_cc1 -DNEEDS_LATE_PARSING -fno-experimental-late-parse-attributes -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -DNEEDS_LATE_PARSING -fsyntax-only -verify %s
4 // RUN: %clang_cc1 -UNEEDS_LATE_PARSING -fno-experimental-late-parse-attributes -fsyntax-only -verify=ok %s
5 // RUN: %clang_cc1 -UNEEDS_LATE_PARSING -fsyntax-only -verify=ok %s
7 #define __counted_by(f) __attribute__((counted_by(f)))
9 struct size_known { int dummy; };
11 #ifdef NEEDS_LATE_PARSING
12 struct on_decl {
13 // expected-error@+1{{use of undeclared identifier 'count'}}
14 struct size_known *buf __counted_by(count);
15 int count;
18 #else
20 // ok-no-diagnostics
21 struct on_decl {
22 int count;
23 struct size_known *buf __counted_by(count);
26 #endif