blob: 642c07e7bc112720c4006b3651f7f9cfdc8eae38 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s
Eli Friedman55d3aaf2009-03-27 21:06:47 +00002
Douglas Gregord2c64902010-06-18 21:30:25 +00003__attribute((regparm(2))) int x0(void);
4__attribute((regparm(1.0))) int x1(void); // expected-error{{'regparm' attribute requires integer constant}}
5__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}}
John McCallbdc49d32011-03-02 12:15:05 +00007__attribute((regparm(5,3))) int x4(void); // expected-error{{attribute takes one argument}}
Douglas Gregord2c64902010-06-18 21:30:25 +00008
9void __attribute__((regparm(3))) x5(int);
10void x5(int); // expected-note{{previous declaration is here}}
11void __attribute__((regparm(2))) x5(int); // expected-error{{function declared with with regparm(2) attribute was previously declared with the regparm(3) attribute}}