Tim Northover | 1060eae | 2013-06-21 22:49:34 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -triple armv7-apple-ios -x c++ -emit-llvm -o - %s | FileCheck %s |
| 2 | |
| 3 | // According to the Itanium ABI (3.1.1), types with non-trivial copy |
| 4 | // constructors passed by value should be passed indirectly, with the caller |
| 5 | // creating a temporary. |
| 6 | |
| 7 | struct Empty; |
| 8 | |
| 9 | struct Empty { |
| 10 | Empty(const Empty &e); |
| 11 | bool check(); |
| 12 | }; |
| 13 | |
| 14 | bool foo(Empty e) { |
| 15 | // CHECK: @_Z3foo5Empty(%struct.Empty* %e) |
| 16 | // CHECK: call {{.*}} @_ZN5Empty5checkEv(%struct.Empty* %e) |
| 17 | return e.check(); |
| 18 | } |
| 19 | |
| 20 | void caller(Empty &e) { |
| 21 | // CHECK: @_Z6callerR5Empty(%struct.Empty* %e) |
| 22 | // CHECK: call {{.*}} @_ZN5EmptyC1ERKS_(%struct.Empty* [[NEWTMP:%.*]], %struct.Empty* |
| 23 | // CHECK: call {{.*}} @_Z3foo5Empty(%struct.Empty* [[NEWTMP]]) |
| 24 | foo(e); |
| 25 | } |