Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr119784a.c

raw
1 /* { dg-do compile { target { *-*-linux* && lp64 } } } */
2 /* { dg-options "-O2 -fno-pic -mtune=generic -mgeneral-regs-only -mapxf -mtune-ctrl=prologue_using_move,epilogue_using_move" } */
3 /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
4 /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */
5
6 /* start must save and restore all caller saved registers. */
7
8 /*
9 **start:
10 **.LFB[0-9]+:
11 ** .cfi_startproc
12 ** subq \$248, %rsp
13 **...
14 ** movq %rax, \(%rsp\)
15 ** movq %rdx, 8\(%rsp\)
16 ** movq %rcx, 16\(%rsp\)
17 ** movq %rbx, 24\(%rsp\)
18 ** movq %rsi, 32\(%rsp\)
19 ** movq %rdi, 40\(%rsp\)
20 **...
21 ** movq %rbp, 48\(%rsp\)
22 ** movq %r8, 56\(%rsp\)
23 ** movq %r9, 64\(%rsp\)
24 ** movq %r10, 72\(%rsp\)
25 ** movq %r11, 80\(%rsp\)
26 ** movq %r12, 88\(%rsp\)
27 ** movq %r13, 96\(%rsp\)
28 ** movq %r14, 104\(%rsp\)
29 ** movq %r15, 112\(%rsp\)
30 ** movq %r16, 120\(%rsp\)
31 ** movq %r17, 128\(%rsp\)
32 ** movq %r18, 136\(%rsp\)
33 ** movq %r19, 144\(%rsp\)
34 ** movq %r20, 152\(%rsp\)
35 ** movq %r21, 160\(%rsp\)
36 ** movq %r22, 168\(%rsp\)
37 ** movq %r23, 176\(%rsp\)
38 ** movq %r24, 184\(%rsp\)
39 ** movq %r25, 192\(%rsp\)
40 ** movq %r26, 200\(%rsp\)
41 ** movq %r27, 208\(%rsp\)
42 ** movq %r28, 216\(%rsp\)
43 ** movq %r29, 224\(%rsp\)
44 ** movq %r30, 232\(%rsp\)
45 ** movq %r31, 240\(%rsp\)
46 **...
47 ** call \*code\(%rip\)
48 ** movq \(%rsp\), %rax
49 ** movq 8\(%rsp\), %rdx
50 ** movq 16\(%rsp\), %rcx
51 ** movq 24\(%rsp\), %rbx
52 ** movq 32\(%rsp\), %rsi
53 ** movq 40\(%rsp\), %rdi
54 ** movq 48\(%rsp\), %rbp
55 ** movq 56\(%rsp\), %r8
56 ** movq 64\(%rsp\), %r9
57 ** movq 72\(%rsp\), %r10
58 ** movq 80\(%rsp\), %r11
59 ** movq 88\(%rsp\), %r12
60 ** movq 96\(%rsp\), %r13
61 ** movq 104\(%rsp\), %r14
62 ** movq 112\(%rsp\), %r15
63 ** movq 120\(%rsp\), %r16
64 ** movq 128\(%rsp\), %r17
65 ** movq 136\(%rsp\), %r18
66 ** movq 144\(%rsp\), %r19
67 ** movq 152\(%rsp\), %r20
68 ** movq 160\(%rsp\), %r21
69 ** movq 168\(%rsp\), %r22
70 ** movq 176\(%rsp\), %r23
71 ** movq 184\(%rsp\), %r24
72 ** movq 192\(%rsp\), %r25
73 ** movq 200\(%rsp\), %r26
74 ** movq 208\(%rsp\), %r27
75 ** movq 216\(%rsp\), %r28
76 ** movq 224\(%rsp\), %r29
77 ** movq 232\(%rsp\), %r30
78 ** movq 240\(%rsp\), %r31
79 ** addq \$248, %rsp
80 **...
81 ** ret
82 ** .cfi_endproc
83 **...
84 */
85
86 #define DONT_SAVE_REGS __attribute__((no_callee_saved_registers))
87 #define SAVE_REGS __attribute__((no_caller_saved_registers))
88
89 typedef DONT_SAVE_REGS void (*op_t)(void);
90
91 extern op_t code[];
92
93 SAVE_REGS void start()
94 {
95 code[0]();
96 }