• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 void funf(float);
2 void fund(double);
3 void funl(long double);
4 
5 #define fung(X) _Generic(X,		\
6 	float:		funf,		\
7 	default:	fund,		\
8 	long double:	funl) (X)
9 
10 #define TEST(name, T)	\
11 static void test ## name(T a) { return fung(a); }
12 
13 TEST(f, float)
14 TEST(d, double)
15 TEST(l, long double)
16 
17 /*
18  * check-name: generic-functions
19  * check-command: test-linearize $file
20  *
21  * check-output-start
22 testf:
23 .L0:
24 	<entry-point>
25 	call        funf, %arg1
26 	ret
27 
28 
29 testd:
30 .L2:
31 	<entry-point>
32 	call        fund, %arg1
33 	ret
34 
35 
36 testl:
37 .L4:
38 	<entry-point>
39 	call        funl, %arg1
40 	ret
41 
42 
43  * check-output-end
44  */
45