OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [fold-eqandshift-1.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* PR middle-end/21137  */
2
/* { dg-do compile } */
3
/* { dg-options "-O2 -fdump-tree-original" } */
4
extern void foo();
5
 
6
void test1(int a)
7
{
8
  if ((a >> 3) & 1)
9
    foo ();
10
}
11
 
12
void test2(int b)
13
{
14
  if ((b >> 3) & 4)
15
    foo ();
16
}
17
 
18
int test3(int c)
19
{
20
  return (c >> 3) & 1;
21
}
22
 
23
int test4(int d)
24
{
25
  return (d >> 3) & 4;
26
}
27
 
28
#if __INT_MAX__ == 32767
29
#define INT_BITS 16
30
#elif __INT_MAX__ == 2147483647
31
#define INT_BITS 32
32
#elif __INT_MAX__ == 9223372036854775807
33
#define INT_BITS 64
34
#else
35
#error Please add support for your target here.
36
#endif
37
 
38
void test5(int e)
39
{
40
  if ((e >> (INT_BITS - 1)) & 64)
41
    foo();
42
}
43
 
44
void test6(unsigned int f)
45
{
46
  if ((f >> (INT_BITS - 1)) & 64)
47
    foo();
48
}
49
 
50
/* { dg-final { scan-tree-dump-times "\\(a \& 8\\) != 0" 1 "original" } } */
51
/* { dg-final { scan-tree-dump-times "\\(b \& 32\\) != 0" 1 "original" } } */
52
/* { dg-final { scan-tree-dump-times "c >> 3 \& 1" 1 "original" } } */
53
/* { dg-final { scan-tree-dump-times "d >> 3 \& 4" 1 "original" } } */
54
/* { dg-final { scan-tree-dump-times "e < 0" 1 "original" } } */
55
/* { dg-final { scan-tree-dump-times "if \\(0\\)" 1 "original" } } */
56
/* { dg-final { cleanup-tree-dump "original" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.