xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/decl-ref-init.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm %s -o - | \
2*0a6a1f1dSLionel Sambuc // RUN: FileCheck %s
3*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple i386-apple-darwin -emit-llvm %s -o - | \
4*0a6a1f1dSLionel Sambuc // RUN: FileCheck %s
5f4a2713aSLionel Sambuc 
6f4a2713aSLionel Sambuc struct A {};
7f4a2713aSLionel Sambuc 
8f4a2713aSLionel Sambuc struct B
9f4a2713aSLionel Sambuc {
10f4a2713aSLionel Sambuc   operator A&();
11f4a2713aSLionel Sambuc };
12f4a2713aSLionel Sambuc 
13f4a2713aSLionel Sambuc 
14f4a2713aSLionel Sambuc struct D : public B {
15f4a2713aSLionel Sambuc   operator A();
16f4a2713aSLionel Sambuc };
17f4a2713aSLionel Sambuc 
18f4a2713aSLionel Sambuc extern B f();
19f4a2713aSLionel Sambuc extern D d();
20f4a2713aSLionel Sambuc 
main()21f4a2713aSLionel Sambuc int main() {
22f4a2713aSLionel Sambuc 	const A& rca = f();
23f4a2713aSLionel Sambuc 	const A& rca2 = d();
24f4a2713aSLionel Sambuc }
25f4a2713aSLionel Sambuc 
26*0a6a1f1dSLionel Sambuc // CHECK: call dereferenceable({{[0-9]+}}) %struct.A* @_ZN1BcvR1AEv
27*0a6a1f1dSLionel Sambuc // CHECK: call dereferenceable({{[0-9]+}}) %struct.A* @_ZN1BcvR1AEv
28