xref: /aosp_15_r20/external/clang/test/SemaCXX/attr-regparm.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-pc-linux-gnu %s
2*67e74705SXin Li // RUN: %clang_cc1 -fsyntax-only -verify -triple i686-apple-darwin10 %s
3*67e74705SXin Li 
4*67e74705SXin Li // PR7025
5*67e74705SXin Li struct X0 {
6*67e74705SXin Li   void __attribute__((regparm(3))) f0();
7*67e74705SXin Li   void __attribute__((regparm(3))) f1();
8*67e74705SXin Li   void __attribute__((regparm(3))) f2(); // expected-note{{previous declaration is here}}
9*67e74705SXin Li   void f3(); // expected-note{{previous declaration is here}}
10*67e74705SXin Li };
11*67e74705SXin Li 
f0()12*67e74705SXin Li void X0::f0() { }
f1()13*67e74705SXin Li void __attribute__((regparm(3))) X0::f1() { }
f2()14*67e74705SXin Li void __attribute__((regparm(2))) X0::f2() { } // expected-error{{function declared with regparm(2) attribute was previously declared with the regparm(3) attribute}}
f3()15*67e74705SXin Li void __attribute__((regparm(2))) X0::f3() { } // expected-error{{function declared with regparm(2) attribute was previously declared without the regparm attribute}}
16