Debian Codegraph @

gcc/testsuite/gcc.target/nvptx/abi-struct-arg.c

raw
1 /* { dg-do compile } */
2 /* { dg-additional-options "-Wno-pedantic -Wno-long-long -m64" } */
3
4 /* Struct arg. Passed via pointer. */
5
6 typedef struct {} empty; /* See 'gcc/doc/extend.texi', "Empty Structures". */
7 typedef struct {char a;} one;
8 typedef struct {short a;} two;
9 typedef struct {int a;} four;
10 typedef struct {long long a;} eight;
11 typedef struct {int a, b[12];} big;
12
13 /* { dg-final { scan-assembler-times ".extern .func dcl_aempty \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
14 void dcl_aempty (empty);
15
16 /* { dg-final { scan-assembler-times ".extern .func dcl_aone \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
17 void dcl_aone (one);
18
19 /* { dg-final { scan-assembler-times ".extern .func dcl_atwo \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
20 void dcl_atwo (two);
21
22 /* { dg-final { scan-assembler-times ".extern .func dcl_afour \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
23 void dcl_afour (four);
24
25 /* { dg-final { scan-assembler-times ".extern .func dcl_aeight \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
26 void dcl_aeight (eight);
27
28 /* { dg-final { scan-assembler-times ".extern .func dcl_abig \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
29 void dcl_abig (big);
30
31 #define M(T, v) ({T t; t.a = v; t;})
32
33 void test_1 (void)
34 {
35 dcl_aempty (({empty t; t;}));
36 dcl_aone (M (one, 1));
37 dcl_atwo (M (two, 2));
38 dcl_afour (M (four, 3));
39 dcl_aeight (M (eight, 4));
40 dcl_abig (M (big, 5));
41 }
42
43 /* { dg-final { scan-assembler-times ".visible .func dfn_aempty \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
44 void dfn_aempty (empty empty)
45 {
46 }
47
48 /* { dg-final { scan-assembler-times ".visible .func dfn_aone \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
49 void dfn_aone (one one)
50 {
51 }
52
53 /* { dg-final { scan-assembler-times ".visible .func dfn_atwo \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
54 void dfn_atwo (two two)
55 {
56 }
57
58 /* { dg-final { scan-assembler-times ".visible .func dfn_afour \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
59 void dfn_afour (four four)
60 {
61 }
62
63 /* { dg-final { scan-assembler-times ".visible .func dfn_aeight \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
64 void dfn_aeight (eight eight)
65 {
66 }
67
68 /* { dg-final { scan-assembler-times ".visible .func dfn_abig \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
69 void dfn_abig (big big)
70 {
71 }
72