summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr27971.c
blob: 27888de6d2f50eb39eedcb2ee73917e56ca6b965 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* { dg-do compile } */
/* { dg-options "-O2" } */

unsigned array[4];

#ifdef _WIN64
__extension__ typedef unsigned long long TYPE;
#else
#define TYPE unsigned long
#endif

unsigned foo(TYPE x)
{
          return array[(x>>2)&3ul];
}

/* { dg-final { scan-assembler-not "shr\[^\\n\]*2" } } */
/* { dg-final { scan-assembler "and\[^\\n\]*12" } } */