xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/decl-ref-init.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // REQUIRES: x86-registered-target,x86-64-registered-target
2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-apple-darwin -S %s -o %t-64.s
3*f4a2713aSLionel Sambuc // RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
4*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple i386-apple-darwin -S %s -o %t-32.s
5*f4a2713aSLionel Sambuc // RUN: FileCheck -check-prefix CHECK-LP32 --input-file=%t-32.s %s
6*f4a2713aSLionel Sambuc 
7*f4a2713aSLionel Sambuc struct A {};
8*f4a2713aSLionel Sambuc 
9*f4a2713aSLionel Sambuc struct B
10*f4a2713aSLionel Sambuc {
11*f4a2713aSLionel Sambuc   operator A&();
12*f4a2713aSLionel Sambuc };
13*f4a2713aSLionel Sambuc 
14*f4a2713aSLionel Sambuc 
15*f4a2713aSLionel Sambuc struct D : public B {
16*f4a2713aSLionel Sambuc   operator A();
17*f4a2713aSLionel Sambuc };
18*f4a2713aSLionel Sambuc 
19*f4a2713aSLionel Sambuc extern B f();
20*f4a2713aSLionel Sambuc extern D d();
21*f4a2713aSLionel Sambuc 
22*f4a2713aSLionel Sambuc int main() {
23*f4a2713aSLionel Sambuc 	const A& rca = f();
24*f4a2713aSLionel Sambuc 	const A& rca2 = d();
25*f4a2713aSLionel Sambuc }
26*f4a2713aSLionel Sambuc 
27*f4a2713aSLionel Sambuc // CHECK-LP64: callq    __ZN1BcvR1AEv
28*f4a2713aSLionel Sambuc // CHECK-LP64: callq    __ZN1BcvR1AEv
29*f4a2713aSLionel Sambuc 
30*f4a2713aSLionel Sambuc // CHECK-LP32: calll     L__ZN1BcvR1AEv
31*f4a2713aSLionel Sambuc // CHECK-LP32: calll     L__ZN1BcvR1AEv
32