1 /* { dg-do compile } */
2 /* { dg-additional-options "-Wno-pedantic -Wno-long-long -m64 -fshort-enums" } */
3
4 /* Enum return types. Passed as the underlying integer. */
5
6 typedef enum { a = 0x1, b } Echar;
7 typedef enum { c = 0x100, d } Eshort;
8 typedef enum { e = 0x10000, f } Eint;
9 typedef enum { g = 0x100000000LL, h } Elonglong;
10
11 /* { dg-final { scan-assembler-times ".extern .func \\(.param.u32 %\[_a-z\]*\\) dcl_rc;" 1 } } */
12 Echar dcl_rc (void);
13
14 /* { dg-final { scan-assembler-times ".extern .func \\(.param.u32 %\[_a-z\]*\\) dcl_rs;" 1 } } */
15 Eshort dcl_rs (void);
16
17 /* { dg-final { scan-assembler-times ".extern .func \\(.param.u32 %\[_a-z\]*\\) dcl_ri;" 1 } } */
18 Eint dcl_ri (void);
19
20 /* { dg-final { scan-assembler-times ".extern .func \\(.param.u64 %\[_a-z\]*\\) dcl_rll;" 1 } } */
21 Elonglong dcl_rll (void);
22
test_1(void)23 void test_1 (void)
24 {
25 dcl_rc ();
26 dcl_rs ();
27 dcl_ri ();
28 dcl_rll ();
29 }
30
31 /* { dg-final { scan-assembler-times ".visible .func \\(.param.u32 %\[_a-z0-9\]*\\) dfn_rc(?:;|\[\r\n\]+\{)" 2 } } */
dfn_rc(void)32 Echar dfn_rc (void)
33 {
34 return 1;
35 }
36
37 /* { dg-final { scan-assembler-times ".visible .func \\(.param.u32 %\[_a-z0-0\]*\\) dfn_rs(?:;|\[\r\n\]+\{)" 2 } } */
dfn_rs(void)38 Eshort dfn_rs (void)
39 {
40 return 2;
41 }
42
43 /* { dg-final { scan-assembler-times ".visible .func \\(.param.u32 %\[_a-z0-9\]*\\) dfn_ri(?:;|\[\r\n\]+\{)" 2 } } */
dfn_ri(void)44 Eint dfn_ri (void)
45 {
46 return 3;
47 }
48
49 /* { dg-final { scan-assembler-times ".visible .func \\(.param.u64 %\[_a-z0-9\]*\\) dfn_rll(?:;|\[\r\n\]+\{)" 2 } } */
dfn_rll(void)50 Elonglong dfn_rll (void)
51 {
52 return 4;
53 }
54