Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s |
Douglas Gregor | 0a9a6d6 | 2011-01-26 17:36:28 +0000 | [diff] [blame] | 2 | struct X { |
| 3 | int f() &; |
| 4 | int g() &&; |
| 5 | int h() const &&; |
| 6 | }; |
| 7 | |
| 8 | // CHECK: define i32 @_ZNR1X1fEv |
| 9 | int X::f() & { return 0; } |
| 10 | // CHECK: define i32 @_ZNO1X1gEv |
| 11 | int X::g() && { return 0; } |
| 12 | // CHECK: define i32 @_ZNKO1X1hEv |
| 13 | int X::h() const && { return 0; } |
| 14 | |
John McCall | 4b50263 | 2012-05-15 02:01:59 +0000 | [diff] [blame] | 15 | // CHECK: define void @_Z1fM1XFivREMS_FivOEMS_KFivOE |
Douglas Gregor | 0a9a6d6 | 2011-01-26 17:36:28 +0000 | [diff] [blame] | 16 | void f(int (X::*)() &, int (X::*)() &&, int (X::*)() const&&) { } |
John McCall | 4b50263 | 2012-05-15 02:01:59 +0000 | [diff] [blame] | 17 | |
| 18 | // CHECK: define void @_Z1g1AIFivEES_IFivREES_IFivOEES_IKFivEES_IKFivREES_IKFivOEES_IVKFivEES_IVKFivREES_IVKFivOEE() |
| 19 | template <class T> struct A {}; |
| 20 | void g(A<int()>, A<int()&>, A<int()&&>, |
| 21 | A<int() const>, A<int() const &>, A<int() const &&>, |
| 22 | A<int() const volatile>, A<int() const volatile &>, A<int() const volatile &&>) {} |