1 /* { dg-do compile } */
2 /* { dg-additional-options "-Wno-pedantic -Wno-long-long -m64" } */
3
4 /* K+R args. as for ANSI except float promotes to double. */
5
6 /* { dg-final { scan-assembler-times ".extern .func dcl_av;" 1 } } */
7 void dcl_av ();
8
9 /* { dg-final { scan-assembler-times ".extern .func dcl_ac \\(.param.u32 %\[_a-z0-9\]*\\);" 1 } } */
10 void dcl_ac ();
11
12 /* { dg-final { scan-assembler-times ".extern .func dcl_as \\(.param.u32 %\[_a-z0-9\]*\\);" 1 } } */
13 void dcl_as ();
14
15 /* { dg-final { scan-assembler-times ".extern .func dcl_ai \\(.param.u32 %\[_a-z0-9\]*\\);" 1 } } */
16 void dcl_ai ();
17
18 /* { dg-final { scan-assembler-times ".extern .func dcl_all \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
19 void dcl_all ();
20
21 /* { dg-final { scan-assembler-times ".extern .func dcl_af \\(.param.f64 %\[_a-z0-9\]*\\);" 1 } } */
22 void dcl_af ();
23
24 /* { dg-final { scan-assembler-times ".extern .func dcl_ad \\(.param.f64 %\[_a-z0-9\]*\\);" 1 } } */
25 void dcl_ad ();
26
27 /* { dg-final { scan-assembler-times ".extern .func dcl_ap \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
28 void dcl_ap ();
29
test_1(void)30 void test_1 (void)
31 {
32 dcl_av ();
33 dcl_ac ((char)1);
34 dcl_as ((short)2);
35 dcl_ai ((int)3);
36 dcl_all ((long long)4);
37 dcl_af ((float)5);
38 dcl_ad ((double)6);
39 dcl_ap ((void *)0);
40 }
41
42 /* { dg-final { scan-assembler-times ".visible .func dfn_av(?:;|\[\r\n\]+\{)" 2 } } */
dfn_av()43 void dfn_av ()
44 {
45 }
46
47 /* { dg-final { scan-assembler-times ".visible .func dfn_ac \\(.param.u32 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
dfn_ac(c)48 void dfn_ac (c)
49 char c;
50 {
51 }
52
53 /* { dg-final { scan-assembler-times ".visible .func dfn_as \\(.param.u32 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
dfn_as(s)54 void dfn_as (s)
55 short s;
56 {
57 }
58
59 /* { dg-final { scan-assembler-times ".visible .func dfn_ai \\(.param.u32 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
dfn_ai(i)60 void dfn_ai (i)
61 int i;
62 {
63 }
64
65 /* { dg-final { scan-assembler-times ".visible .func dfn_all \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
dfn_all(ll)66 void dfn_all (ll)
67 long long ll;
68 {
69 }
70
71 /* { dg-final { scan-assembler-times ".visible .func dfn_af \\(.param.f64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
dfn_af(f)72 void dfn_af (f)
73 float f;
74 {
75 }
76
77 /* { dg-final { scan-assembler-times ".visible .func dfn_ad \\(.param.f64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
dfn_ad(d)78 void dfn_ad (d)
79 double d;
80 {
81 }
82
83 /* { dg-final { scan-assembler-times ".visible .func dfn_ap \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
dfn_ap(p)84 void dfn_ap (p)
85 void *p;
86 {
87 }
88
89 /* But complex float is passed as two floats. (K&R doesn't have
90 complex, so why obey k&r for the components of such an object?) */
91
92 /* { dg-final { scan-assembler-times ".visible .func dfn_acf \\(.param.f32 %\[_a-z0-9\]*, .param.f32 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
dfn_acf(_Complex float f)93 void dfn_acf (_Complex float f)
94 {
95 }
96