12f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
22f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor
32f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregorstruct Foo {
42f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor  Foo();
52f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor  Foo(const Foo&);
62f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor};
72f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor
82f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregorstruct Bar {
92f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor  Bar();
102f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor  operator const Foo&() const;
112f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor};
122f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor
132f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregorvoid f(Foo);
142f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor
1593ab6bf534fb6c26563c00f28a8fc5581bb71dfdStephen Lin// CHECK-LABEL: define void @_Z1g3Foo(%struct.Foo* %foo)
162f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregorvoid g(Foo foo) {
172f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor  // CHECK: call void @_ZN3BarC1Ev
182f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor  // CHECK: @_ZNK3BarcvRK3FooEv
192f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor  // CHECK: call void @_Z1f3Foo
202f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor  f(Bar());
212f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor  // CHECK: call void @_ZN3FooC1Ev
222f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor  // CHECK: call void @_Z1f3Foo
232f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor  f(Foo());
242f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor  // CHECK: call void @_ZN3FooC1ERKS_
252f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor  // CHECK: call void @_Z1f3Foo
262f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor  f(foo);
272f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor  // CHECK: ret
282f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor}
292f59979a7cc7929f53c9984423b0abeb83113442Douglas Gregor
30