blob: 73e9b94bcd11d0159185c382cc3dcf4eb6f158e2 [file] [log] [blame]
Eli Friedmancb48f8a2009-12-24 23:33:34 +00001// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
2
3struct A { int x; A(int); ~A(); };
4A f() { return A(0); }
5// CHECK: define void @_Z1fv
6// CHECK: call void @_ZN1AC1Ei
7// CHECK-NEXT: ret void
Douglas Gregorb8f7de92010-08-22 18:27:02 +00008
9// Verify that we do not elide copies when constructing a base class.
10namespace no_elide_base {
11 struct Base {
12 Base(const Base&);
13 ~Base();
14 };
15
16 struct Other {
17 operator Base() const;
18 };
19
20 struct Derived : public virtual Base {
21 Derived(const Other &O);
22 };
23
24 // CHECK: define void @_ZN13no_elide_base7DerivedC1ERKNS_5OtherE
25 Derived::Derived(const Other &O)
26 // CHECK: call void @_ZNK13no_elide_base5OthercvNS_4BaseEEv
27 // CHECK: call void @_ZN13no_elide_base4BaseC2ERKS0_
28 // CHECK: call void @_ZN13no_elide_base4BaseD1Ev
29 : Base(O)
30 {
31 // CHECK: ret void
32 }
33}