1a5728872c7702ddd09537c95bc3cbd20e1f2fb09Daniel Dunbar// RUN: %clang_cc1 -fsyntax-only -verify %s 23068ae0feb5d477477f45045f7ec9d0414fe57f3Daniel Dunbar 3d6b8de0e7b01196bd2bee207feb81bc409a5baf9John McCallint x __attribute__((constructor)); // expected-warning {{'constructor' attribute only applies to functions}} 43068ae0feb5d477477f45045f7ec9d0414fe57f3Daniel Dunbarint f() __attribute__((constructor)); 53068ae0feb5d477477f45045f7ec9d0414fe57f3Daniel Dunbarint f() __attribute__((constructor(1))); 6bdc49d360f98c1194d50b8bbb24885bf8d4c1ac4John McCallint f() __attribute__((constructor(1,2))); // expected-error {{attribute takes no more than 1 argument}} 73068ae0feb5d477477f45045f7ec9d0414fe57f3Daniel Dunbarint f() __attribute__((constructor(1.0))); // expected-error {{'constructor' attribute requires parameter 1 to be an integer constant}} 83068ae0feb5d477477f45045f7ec9d0414fe57f3Daniel Dunbar 9d6b8de0e7b01196bd2bee207feb81bc409a5baf9John McCallint x __attribute__((destructor)); // expected-warning {{'destructor' attribute only applies to functions}} 103068ae0feb5d477477f45045f7ec9d0414fe57f3Daniel Dunbarint f() __attribute__((destructor)); 113068ae0feb5d477477f45045f7ec9d0414fe57f3Daniel Dunbarint f() __attribute__((destructor(1))); 12bdc49d360f98c1194d50b8bbb24885bf8d4c1ac4John McCallint f() __attribute__((destructor(1,2))); // expected-error {{attribute takes no more than 1 argument}} 133068ae0feb5d477477f45045f7ec9d0414fe57f3Daniel Dunbarint f() __attribute__((destructor(1.0))); // expected-error {{'destructor' attribute requires parameter 1 to be an integer constant}} 143068ae0feb5d477477f45045f7ec9d0414fe57f3Daniel Dunbar 153068ae0feb5d477477f45045f7ec9d0414fe57f3Daniel Dunbar 16