aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/msp430/mlarge-use-430-insn.c
blob: efa598be685777599e71d997377e726205c41495 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-mcpu=msp430" "-mcpu=430" "-msmall" } { "" } } */
/* { dg-options "-mlarge -O1" } */
/* { dg-final { check-function-bodies "**" "" } } */

/* Test to verify cases where we can use a 430 insn even in the large memory
   model.  */

int foo[2];

/*
** func:  { target msp430_region_lower }
** ...
**	MOV.W	#-4088, &foo
**	MOV.W	#-8531, &40960
**	MOVX.W	#-16657, &106496
** ...
*/
/*
** func:  { target msp430_region_not_lower }
** ...
**	MOVX.W	#-4088, &foo
**	MOV.W	#-8531, &40960
**	MOVX.W	#-16657, &106496
** ...
*/
void
func (void)
{
  foo[0] = 0xF008;
  (*(int *)0xA000) = 0xDEAD;
  (*(int *)0x1A000) = 0xBEEF;
}