1*c85f09ccSJohn Levon extern int fun(int);
2*c85f09ccSJohn Levon 
3*c85f09ccSJohn Levon typedef int (*fun_t)(int);
4*c85f09ccSJohn Levon 
fa(void)5*c85f09ccSJohn Levon fun_t fa(void) { return &fun; }
f0(void)6*c85f09ccSJohn Levon fun_t f0(void) { return  fun; }
f1(void)7*c85f09ccSJohn Levon fun_t f1(void) { return *fun; }
8*c85f09ccSJohn Levon 
9*c85f09ccSJohn Levon /*
10*c85f09ccSJohn Levon  * check-name: degen-function
11*c85f09ccSJohn Levon  * check-command: test-linearize -m64 -Wno-decl -fdump-ir=linearize $file
12*c85f09ccSJohn Levon  * check-assert: sizeof(void *) == 8
13*c85f09ccSJohn Levon  *
14*c85f09ccSJohn Levon  * check-output-start
15*c85f09ccSJohn Levon fa:
16*c85f09ccSJohn Levon .L0:
17*c85f09ccSJohn Levon 	<entry-point>
18*c85f09ccSJohn Levon 	symaddr.64  %r1 <- fun
19*c85f09ccSJohn Levon 	phisrc.64   %phi1(return) <- %r1
20*c85f09ccSJohn Levon 	br          .L1
21*c85f09ccSJohn Levon 
22*c85f09ccSJohn Levon .L1:
23*c85f09ccSJohn Levon 	phi.64      %r2 <- %phi1(return)
24*c85f09ccSJohn Levon 	ret.64      %r2
25*c85f09ccSJohn Levon 
26*c85f09ccSJohn Levon 
27*c85f09ccSJohn Levon f0:
28*c85f09ccSJohn Levon .L2:
29*c85f09ccSJohn Levon 	<entry-point>
30*c85f09ccSJohn Levon 	symaddr.64  %r3 <- fun
31*c85f09ccSJohn Levon 	phisrc.64   %phi2(return) <- %r3
32*c85f09ccSJohn Levon 	br          .L3
33*c85f09ccSJohn Levon 
34*c85f09ccSJohn Levon .L3:
35*c85f09ccSJohn Levon 	phi.64      %r4 <- %phi2(return)
36*c85f09ccSJohn Levon 	ret.64      %r4
37*c85f09ccSJohn Levon 
38*c85f09ccSJohn Levon 
39*c85f09ccSJohn Levon f1:
40*c85f09ccSJohn Levon .L4:
41*c85f09ccSJohn Levon 	<entry-point>
42*c85f09ccSJohn Levon 	symaddr.64  %r5 <- fun
43*c85f09ccSJohn Levon 	phisrc.64   %phi3(return) <- %r5
44*c85f09ccSJohn Levon 	br          .L5
45*c85f09ccSJohn Levon 
46*c85f09ccSJohn Levon .L5:
47*c85f09ccSJohn Levon 	phi.64      %r6 <- %phi3(return)
48*c85f09ccSJohn Levon 	ret.64      %r6
49*c85f09ccSJohn Levon 
50*c85f09ccSJohn Levon 
51*c85f09ccSJohn Levon  * check-output-end
52*c85f09ccSJohn Levon  */
53