blob: 4049e0e8a13fd44f0182baca1a2003000479de73 [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}}
7__attribute((regparm(5,3))) int x4(void); // expected-error{{attribute requires 1 argument(s)}}
8
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}}