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" } } */