blob: d50dd113f70f98b1433fd54dac41959d3c82d59c [file] [log] [blame]
Daniel Dunbar8fbe78f2009-12-15 20:14:24 +00001// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s
Eli Friedman7044b762009-03-27 21:06:47 +00002
Douglas Gregor77e274f2010-06-18 21:30:25 +00003__attribute((regparm(2))) int x0(void);
Aaron Ballman9d695092013-07-30 14:10:17 +00004__attribute((regparm(1.0))) int x1(void); // expected-error{{'regparm' attribute requires an integer constant}}
Douglas Gregor77e274f2010-06-18 21:30:25 +00005__attribute((regparm(-1))) int x2(void); // expected-error{{'regparm' parameter must be between 0 and 3 inclusive}}
6__attribute((regparm(5))) int x3(void); // expected-error{{'regparm' parameter must be between 0 and 3 inclusive}}
Aaron Ballmanb7243382013-07-23 19:30:11 +00007__attribute((regparm(5,3))) int x4(void); // expected-error{{'regparm' attribute takes one argument}}
Douglas Gregor77e274f2010-06-18 21:30:25 +00008
9void __attribute__((regparm(3))) x5(int);
10void x5(int); // expected-note{{previous declaration is here}}
Richard Smith463abbb2013-02-21 23:15:05 +000011void __attribute__((regparm(2))) x5(int); // expected-error{{function declared with regparm(2) attribute was previously declared with the regparm(3) attribute}}