blob: 6a950979d36f172247ff42cfda65be7bd7ac7e82 [file] [log] [blame]
Daniel Dunbar8fbe78f2009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Daniel Dunbar032db472008-07-31 22:40:48 +00002
John McCall4bb48362011-01-25 03:51:08 +00003int x __attribute__((constructor)); // expected-warning {{'constructor' attribute only applies to functions}}
Daniel Dunbar032db472008-07-31 22:40:48 +00004int f() __attribute__((constructor));
5int f() __attribute__((constructor(1)));
John McCall80ee5962011-03-02 12:15:05 +00006int f() __attribute__((constructor(1,2))); // expected-error {{attribute takes no more than 1 argument}}
Aaron Ballmanf22ef5a2013-11-21 01:50:40 +00007int f() __attribute__((constructor(1.0))); // expected-error {{'constructor' attribute requires an integer constant}}
Daniel Dunbar032db472008-07-31 22:40:48 +00008
John McCall4bb48362011-01-25 03:51:08 +00009int x __attribute__((destructor)); // expected-warning {{'destructor' attribute only applies to functions}}
Daniel Dunbar032db472008-07-31 22:40:48 +000010int f() __attribute__((destructor));
11int f() __attribute__((destructor(1)));
John McCall80ee5962011-03-02 12:15:05 +000012int f() __attribute__((destructor(1,2))); // expected-error {{attribute takes no more than 1 argument}}
Aaron Ballmanf22ef5a2013-11-21 01:50:40 +000013int f() __attribute__((destructor(1.0))); // expected-error {{'destructor' attribute requires an integer constant}}
Daniel Dunbar032db472008-07-31 22:40:48 +000014
15