blob: 9ee3281505ec3d0bc6884be9d822f1dc80d8b08e [file] [log] [blame]
Tim Northover1060eae2013-06-21 22:49:34 +00001// 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
7struct Empty;
8
9struct Empty {
10 Empty(const Empty &e);
11 bool check();
12};
13
14bool foo(Empty e) {
15// CHECK: @_Z3foo5Empty(%struct.Empty* %e)
16// CHECK: call {{.*}} @_ZN5Empty5checkEv(%struct.Empty* %e)
17 return e.check();
18}
19
20void 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}