New bswap testcase.

2019-12-08  Andrew Pinski  <apinski@marvell.com>

        * gcc.c-torture/execute/bswap-3.c: New test.

From-SVN: r279100
This commit is contained in:
Andrew Pinski 2019-12-08 21:59:25 +00:00 committed by Andrew Pinski
parent 58ccb8ec7c
commit a0d169d17a
2 changed files with 29 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2019-12-08 Andrew Pinski <apinski@marvell.com>
* gcc.c-torture/execute/bswap-3.c: New test.
2019-12-08 Sandra Loosemore <sandra@codesourcery.com>
Revert:

View File

@ -0,0 +1,25 @@
/* { dg-require-effective-target int32plus } */
int f(unsigned int a) __attribute__((noipa));
int f(unsigned int a)
{
return ((__builtin_bswap32(a))>>24) & 0x3;
}
int g(unsigned int a) __attribute__((noipa));
int g(unsigned int a)
{
return a&0x3;
}
int main(void)
{
for (int b = 0; b <= 0xF; b++)
{
if (f(b) != g(b))
__builtin_abort ();
}
return 0;
}