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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [arm/] [cmp-1.c] - Blame information for rev 691

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O" } */
3
/* { dg-final { scan-assembler-not "\tbl\t" } } */
4
/* { dg-final { scan-assembler-not "__aeabi" } } */
5
int x, y;
6
 
7
#define TEST_EXPR(NAME, ARGS, EXPR)                     \
8
  int NAME##1 ARGS { return (EXPR); }                   \
9
  int NAME##2 ARGS { return !(EXPR); }                  \
10
  int NAME##3 ARGS { return (EXPR) ? x : y; }           \
11
  void NAME##4 ARGS { if (EXPR) x++; }                  \
12
  void NAME##5 ARGS { if (!(EXPR)) x++; }
13
 
14
#define TEST(NAME, TYPE, OPERATOR) \
15
  TEST_EXPR (NAME##_rr, (TYPE a1, TYPE a2), a1 OPERATOR a2)     \
16
  TEST_EXPR (NAME##_rm, (TYPE a1, TYPE *a2), a1 OPERATOR *a2)   \
17
  TEST_EXPR (NAME##_mr, (TYPE *a1, TYPE a2), *a1 OPERATOR a2)   \
18
  TEST_EXPR (NAME##_mm, (TYPE *a1, TYPE *a2), *a1 OPERATOR *a2) \
19
  TEST_EXPR (NAME##_rc, (TYPE a1), a1 OPERATOR 100)             \
20
  TEST_EXPR (NAME##_cr, (TYPE a1), 100 OPERATOR a1)
21
 
22
#define TEST_OP(NAME, OPERATOR) \
23
  TEST (sc_##NAME, signed char, OPERATOR)               \
24
  TEST (uc_##NAME, unsigned char, OPERATOR)             \
25
  TEST (ss_##NAME, short, OPERATOR)                     \
26
  TEST (us_##NAME, unsigned short, OPERATOR)            \
27
  TEST (si_##NAME, int, OPERATOR)                       \
28
  TEST (ui_##NAME, unsigned int, OPERATOR)              \
29
  TEST (sll_##NAME, long long, OPERATOR)                \
30
  TEST (ull_##NAME, unsigned long long, OPERATOR)
31
 
32
TEST_OP (eq, ==)
33
TEST_OP (ne, !=)
34
TEST_OP (lt, <)
35
TEST_OP (gt, >)
36
TEST_OP (le, <=)
37
TEST_OP (ge, >=)

powered by: WebSVN 2.1.0

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