Debian Codegraph @

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

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O3" } */
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 -O3. */
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 ** CALL.* #ext
33 ** CALL.* #ext
34 ** ...
35 */
36
37 void
38 bar (void)
39 {
40 ext ();
41 ext ();
42 }