diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/pr90693.c')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr90693.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr90693.c b/gcc/testsuite/gcc.target/i386/pr90693.c new file mode 100644 index 0000000..1659f26 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr90693.c @@ -0,0 +1,29 @@ +/* PR tree-optimization/90693 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -mno-abm -mno-popcnt -fdump-tree-optimized" } */ +/* { dg-final { scan-tree-dump-not "POPCOUNT \\\(" "optimized" } } */ +/* { dg-final { scan-tree-dump-not "__builtin_popcount(ll)? \\\(" "optimized" } } */ + +int +foo (unsigned int x) +{ + return __builtin_popcount (x) == 1; +} + +int +bar (unsigned int x) +{ + return (x ^ (x - 1)) > x - 1; +} + +int +baz (unsigned long long x) +{ + return __builtin_popcountll (x) == 1; +} + +int +qux (unsigned long long x) +{ + return (x ^ (x - 1)) > x - 1; +} |