summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/vax/peephole2-eq-andsi.c
blob: b84c35299ea5639a7bd50338e77d866d35a9371a (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
/* { dg-do compile } */
/* { dg-options "-fdump-rtl-peephole2 -dp" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" "-O1" } { "" } } */

typedef int __attribute__ ((mode (SI))) int_t;

int_t
eq_andsi (int_t x, int_t y)
{
  x &= y;
  if (x == 0)
    return 1;
  else
    return 2;
}

/* Expect assembly like:

	bitl 4(%ap),8(%ap)		# 52	[c=34]  *bitsi_ccz
	jneq .L6			# 41	[c=26]  *branch_ccz
	movl $1,%r0			# 36	[c=4]  *movsi_2
	ret				# 47	[c=0]  return
.L6:

 */

/* { dg-final { scan-rtl-dump-times "Splitting with gen_peephole2" 1 "peephole2" } } */
/* { dg-final { scan-assembler-not "\t(cmpz?|tst). " } } */
/* { dg-final { scan-assembler "bitsi\[^ \]*_ccz(/\[0-9\]+)?\n" } } */
/* { dg-final { scan-assembler "branch_ccz\n" } } */