Mercurial > hg > CbC > CbC_llvm
diff clang/test/Sema/attr-loader-uninitialized.cpp @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | 0572611fdcc8 |
children |
line wrap: on
line diff
--- a/clang/test/Sema/attr-loader-uninitialized.cpp Mon May 25 11:55:54 2020 +0900 +++ b/clang/test/Sema/attr-loader-uninitialized.cpp Tue Jun 08 06:07:14 2021 +0900 @@ -5,10 +5,13 @@ int hidden_ok __attribute__((visibility("hidden"))) __attribute__((loader_uninitialized)); const int still_cant_be_const __attribute__((loader_uninitialized)); -// expected-error@-1 {{default initialization of an object of const type}} extern int external_rejected __attribute__((loader_uninitialized)); // expected-error@-1 {{variable 'external_rejected' cannot be declared both 'extern' and with the 'loader_uninitialized' attribute}} +struct S; +extern S incomplete_external_rejected __attribute__((loader_uninitialized)); +// expected-error@-1 {{variable 'incomplete_external_rejected' cannot be declared both 'extern' and with the 'loader_uninitialized' attribute}} + int noargs __attribute__((loader_uninitialized(0))); // expected-error@-1 {{'loader_uninitialized' attribute takes no arguments}} @@ -58,3 +61,12 @@ nontrivial needs_trivial_ctor __attribute__((loader_uninitialized)); // expected-error@-1 {{variable with 'loader_uninitialized' attribute must have a trivial default constructor}} + +struct Incomplete; +Incomplete incomplete __attribute__((loader_uninitialized)); +// expected-error@-1 {{variable has incomplete type 'Incomplete'}} +// expected-note@-3 {{forward declaration of 'Incomplete'}} + +struct Incomplete s_incomplete __attribute__((loader_uninitialized)); +// expected-error@-1 {{variable has incomplete type 'struct Incomplete'}} +// expected-note@-7 {{forward declaration of 'Incomplete'}}