xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/mangle-ref-qualifiers.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
2*f4a2713aSLionel Sambuc struct X {
3*f4a2713aSLionel Sambuc   int f() &;
4*f4a2713aSLionel Sambuc   int g() &&;
5*f4a2713aSLionel Sambuc   int h() const &&;
6*f4a2713aSLionel Sambuc };
7*f4a2713aSLionel Sambuc 
8*f4a2713aSLionel Sambuc // CHECK-LABEL: define i32 @_ZNR1X1fEv
f()9*f4a2713aSLionel Sambuc int X::f() & { return 0; }
10*f4a2713aSLionel Sambuc // CHECK-LABEL: define i32 @_ZNO1X1gEv
g()11*f4a2713aSLionel Sambuc int X::g() && { return 0; }
12*f4a2713aSLionel Sambuc // CHECK-LABEL: define i32 @_ZNKO1X1hEv
h() const13*f4a2713aSLionel Sambuc int X::h() const && { return 0; }
14*f4a2713aSLionel Sambuc 
15*f4a2713aSLionel Sambuc // CHECK-LABEL: define void @_Z1fM1XFivREMS_FivOEMS_KFivOE
f(int (X::*)()&,int (X::*)()&&,int (X::*)()const &&)16*f4a2713aSLionel Sambuc void f(int (X::*)() &, int (X::*)() &&, int (X::*)() const&&) { }
17*f4a2713aSLionel Sambuc 
18*f4a2713aSLionel Sambuc // CHECK-LABEL: define void @_Z1g1AIFivEES_IFivREES_IFivOEES_IKFivEES_IKFivREES_IKFivOEES_IVKFivEES_IVKFivREES_IVKFivOEE()
19*f4a2713aSLionel Sambuc template <class T> struct A {};
g(A<int ()>,A<int ()&>,A<int ()&&>,A<int ()const>,A<int ()const &>,A<int ()const &&>,A<int ()const volatile>,A<int ()const volatile &>,A<int ()const volatile &&>)20*f4a2713aSLionel Sambuc void g(A<int()>, A<int()&>, A<int()&&>,
21*f4a2713aSLionel Sambuc        A<int() const>, A<int() const &>, A<int() const &&>,
22*f4a2713aSLionel Sambuc        A<int() const volatile>, A<int() const volatile &>, A<int() const volatile &&>) {}
23