blob: c712e902f5fb2288d18976ed106d8a200dd0496a [file] [log] [blame]
Reed Kotler373feca2013-01-16 17:10:28 +00001// RUN: %clang_cc1 -triple mipsel-linux-gnu -fsyntax-only -verify %s
2
3void foo32();
4void foo16();
Aaron Ballmanb7243382013-07-23 19:30:11 +00005void __attribute__((nomips16)) foo32();
6void __attribute__((mips16)) foo16();
Reed Kotler373feca2013-01-16 17:10:28 +00007
Aaron Ballmanb7243382013-07-23 19:30:11 +00008void __attribute__((nomips16)) foo32_();
9void __attribute__((mips16)) foo16_();
Reed Kotler373feca2013-01-16 17:10:28 +000010void foo32_();
11void foo16_();
12
Aaron Ballmanb7243382013-07-23 19:30:11 +000013void foo32__() __attribute__((nomips16));
14void foo32__() __attribute__((mips16));
Reed Kotler373feca2013-01-16 17:10:28 +000015
Richard Smith66e71682013-10-24 01:07:54 +000016void foo32a() __attribute__((nomips16(0))) ; // expected-error {{'nomips16' attribute takes no arguments}}
17void __attribute__((mips16(1))) foo16a(); // expected-error {{'mips16' attribute takes no arguments}}
Reed Kotler373feca2013-01-16 17:10:28 +000018
Aaron Ballmanb7243382013-07-23 19:30:11 +000019void __attribute__((nomips16(1, 2))) foo32b(); // expected-error {{'nomips16' attribute takes no arguments}}
20void __attribute__((mips16(1, 2))) foo16b(); // expected-error {{'mips16' attribute takes no arguments}}
Reed Kotler373feca2013-01-16 17:10:28 +000021
22
23__attribute((nomips16)) int a; // expected-error {{attribute only applies to functions}}
24
25__attribute((mips16)) int b; // expected-error {{attribute only applies to functions}}
26
27