* gcc.c-torture/execute/20001228-1.c: New test.

From-SVN: r38517
This commit is contained in:
Geoffrey Keating 2000-12-28 23:50:38 +00:00 committed by Geoffrey Keating
parent 4c58589f1a
commit bc5137ae0f
2 changed files with 32 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2000-12-28 Geoffrey Keating <geoffk@redhat.com>
* gcc.c-torture/execute/20001228-1.c: New test.
2000-12-28 Joseph S. Myers <jsm28@cam.ac.uk>
* gcc.dg/format-strfmon-1.c: New test.

View File

@ -0,0 +1,28 @@
int foo1(void)
{
union {
char a[sizeof (unsigned)];
unsigned b;
} u;
u.b = 0x01;
return u.a[0];
}
int foo2(void)
{
volatile union {
char a[sizeof (unsigned)];
unsigned b;
} u;
u.b = 0x01;
return u.a[0];
}
int main(void)
{
if (foo1() != foo2())
abort ();
exit (0);
}