aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/sh/pr51244-9.c
blob: cca90a8439717542d82028de57e9c4c9b1653f4b (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
34
35
/* Check that compare-branch is inverted properly.
   Example:
	mov.w	.L566,r2	->	mov.w	.L566,r2
	add	r11,r2			add	r11,r2
	mov.l	@(12,r2),r7		mov.l	@(8,r2),r5
	mov.l	@(8,r2),r5		mov.l	@(12,r2),r2
	mov	#0,r2			tst	r2,r2
	cmp/hi	r2,r7			bt	.L534
	bf	.L534
*/
/* { dg-do compile }  */
/* { dg-options "-O2" } */
/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */
/* { dg-final { scan-assembler-not "mov\t#0" } } */
static inline unsigned int
test_03_00 (unsigned int x)
{
  /* Return unassigned value on purpose.  */
  unsigned int res;
  return res;
}

struct S
{
  unsigned int a;
  unsigned int b;
};

int test_03 (struct S* i)
{
 if ((i->a != 2 && i->a != 3) || i->a > test_03_00 (i->b))
   return -5;

 return -55;
}