summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/mips/octeon-exts-4.c
blob: 7e6a578a19ceec9e310416d1ac0ce951ea32a12d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-do compile } */
/* { dg-options "-O -march=octeon -mgp64" } */
/* { dg-final { scan-assembler-not "\tsll\t\[^\n\]*,0" } } */
/* { dg-final { scan-assembler-times "\texts\t" 6 } } */

#define TEST(ID, TYPE, SHIFT)				\
  int NOMIPS16						\
  f##ID (long long y)					\
  {							\
    return (TYPE) ((TYPE) (y >> SHIFT) + 1);		\
  }							\
  int NOMIPS16						\
  g##ID (unsigned long long y)				\
  {							\
    return (TYPE) ((TYPE) (y >> SHIFT) + 1);		\
  }

TEST (1, int, 10)
TEST (2, short, 5)
TEST (3, char, 31)