attr-decl-after-definition.c revision a5728872c7702ddd09537c95bc3cbd20e1f2fb09
1// RUN: %clang_cc1 -fsyntax-only -verify %s 2 3void foo(); 4void foo() __attribute__((unused)); 5void foo() __attribute__((unused)); 6void foo(){} // expected-note {{previous definition is here}} 7void foo() __attribute__((constructor)); // expected-warning {{must precede definition}} 8void foo(); 9 10int bar; 11extern int bar; 12int bar; 13int bar __attribute__((weak)); 14int bar __attribute__((used)); 15extern int bar __attribute__((weak)); 16int bar = 0; // expected-note {{previous definition is here}} 17int bar __attribute__((weak)); // expected-warning {{must precede definition}} 18int bar; 19 20