Eli Friedman | 2e283f0 | 2011-06-06 21:23:05 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-pc-linux-gnu %s |
| 2 | // RUN: %clang_cc1 -fsyntax-only -verify -triple i686-apple-darwin10 %s |
Douglas Gregor | d2c6490 | 2010-06-18 21:30:25 +0000 | [diff] [blame] | 3 | |
| 4 | // PR7025 |
| 5 | struct X0 { |
| 6 | void __attribute__((regparm(3))) f0(); |
| 7 | void __attribute__((regparm(3))) f1(); |
| 8 | void __attribute__((regparm(3))) f2(); // expected-note{{previous declaration is here}} |
| 9 | void f3(); // expected-note{{previous declaration is here}} |
| 10 | }; |
| 11 | |
| 12 | void X0::f0() { } |
| 13 | void __attribute__((regparm(3))) X0::f1() { } |
Richard Smith | b83a5d8 | 2013-02-21 23:15:05 +0000 | [diff] [blame] | 14 | void __attribute__((regparm(2))) X0::f2() { } // expected-error{{function declared with regparm(2) attribute was previously declared with the regparm(3) attribute}} |
| 15 | void __attribute__((regparm(2))) X0::f3() { } // expected-error{{function declared with regparm(2) attribute was previously declared without the regparm attribute}} |