view gcc/testsuite/gcc.dg/fold-and-lshift.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-original" } */

int f(int x)
{
	return (x << 2) & 128;
}

int g(int x)
{
	return !!(x & 32) << 7;
}

int h(int x)
{
	return ((x >> 5) & 1) << 7;
}

int i(int x)
{
	return (x & 32) >> 5 << 7;
}

int j(int x)
{
	return ((x >> 5) & 1) ? 128 : 0;
}

int k(int x)
{
	return (x & 32) ? 128 : 0;
}

/* { dg-final { scan-tree-dump-not " \\? " "original" } } */
/* { dg-final { scan-assembler-not "sarl" { target i?86-*-* x86_64-*-* } } }" */