1 /* { dg-do compile } */ 2 /* { dg-options "-march=octeon" } */ 3 /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */ 4 /* { dg-final { scan-assembler "\tbbit1\t" } } */ 5 /* { dg-final { scan-assembler "\tbbit0\t" } } */ 6 /* { dg-final { scan-assembler-times "\tbbit.\t" 6 } } */ 7 /* { dg-final { scan-assembler-not "andi\t" } } */ 8 9 NOMIPS16 void foo (void); 10 11 NOMIPS16 void f1(long long i)12f1 (long long i) 13 { 14 if (i & 0x80) 15 foo (); 16 } 17 18 NOMIPS16 void f2(int i)19f2 (int i) 20 { 21 if (!(i & 0x80)) 22 foo (); 23 } 24 25 NOMIPS16 void f3(int i)26f3 (int i) 27 { 28 if (i % 2) 29 foo (); 30 } 31 32 NOMIPS16 void f4(int i)33f4 (int i) 34 { 35 if (i & 1) 36 foo (); 37 } 38 39 NOMIPS16 void f5(long long i)40f5 (long long i) 41 { 42 if ((i >> 3) & 1) 43 foo (); 44 } 45 46 unsigned long long r; 47 48 NOMIPS16 static inline __attribute__((always_inline)) int test_bit(unsigned long long nr,const unsigned long long * addr)49test_bit(unsigned long long nr, const unsigned long long *addr) 50 { 51 return 1UL & (addr[nr >> 6] >> (nr & 63ULL)); 52 } 53 54 NOMIPS16 void f6()55f6 () 56 { 57 if (!test_bit(0, &r)) 58 foo (); 59 } 60