From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Sema/attr-decl-after-definition.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 clang/test/Sema/attr-decl-after-definition.c (limited to 'clang/test/Sema/attr-decl-after-definition.c') diff --git a/clang/test/Sema/attr-decl-after-definition.c b/clang/test/Sema/attr-decl-after-definition.c new file mode 100644 index 0000000..4d32e00 --- /dev/null +++ b/clang/test/Sema/attr-decl-after-definition.c @@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +void foo(); +void foo() __attribute__((unused)); +void foo() __attribute__((unused)); +void foo(){} // expected-note {{previous definition is here}} +void foo() __attribute__((constructor)); // expected-warning {{must precede definition}} +void foo(); + +int bar; +extern int bar; +int bar; +int bar __attribute__((weak)); +int bar __attribute__((used)); +extern int bar __attribute__((weak)); +int bar = 0; // expected-note {{previous definition is here}} +int bar __attribute__((weak)); // expected-warning {{must precede definition}} +int bar; + -- cgit v1.2.3