Debian Codegraph @

gcc/testsuite/gcc.target/msp430/rtx-cost-Os-default.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-Os" } */
3 /* { dg-final { check-function-bodies "**" "" } } */
4
5 /* Verify the MSP430 cost model is working as expected for the default ISA
6 (msp430x) and hwmult (none), when compiling at -Os. */
7
8 char arr[2];
9 char a;
10 char *ptr;
11
12 /*
13 ** foo:
14 ** ...
15 ** MOV.B \&a, \&arr\+1
16 ** MOV.* #arr\+2, \&ptr
17 ** ...
18 */
19
20 void
21 foo (void)
22 {
23 arr[1] = a;
24 ptr = arr + 2;
25 }
26
27 extern void ext (void);
28
29 /*
30 ** bar:
31 ** ...
32 ** MOV.* #ext, R10
33 ** CALL.* R10
34 ** CALL.* R10
35 ** ...
36 */
37
38 void
39 bar (void)
40 {
41 ext ();
42 ext ();
43 }