URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 298 |
Rev 338 |
/* { dg-do compile } */
|
/* { dg-do compile } */
|
/* { dg-options "-O1 -fdump-tree-optimized" } */
|
/* { dg-options "-O1 -fdump-tree-optimized" } */
|
|
|
/* Tests for SRA of unions. */
|
/* Tests for SRA of unions. */
|
|
|
|
|
typedef union testunion
|
typedef union testunion
|
{
|
{
|
double d;
|
double d;
|
char f1;
|
char f1;
|
} testunion;
|
} testunion;
|
|
|
void
|
void
|
copyunion1 (testunion param)
|
copyunion1 (testunion param)
|
{
|
{
|
testunion local;
|
testunion local;
|
param.f1 = 0;
|
param.f1 = 0;
|
local = param;
|
local = param;
|
if (local.f1 != 0)
|
if (local.f1 != 0)
|
link_error ();
|
link_error ();
|
}
|
}
|
|
|
void
|
void
|
copyunion11 (testunion *param)
|
copyunion11 (testunion *param)
|
{
|
{
|
testunion local;
|
testunion local;
|
param->f1 = 0;
|
param->f1 = 0;
|
local = *param;
|
local = *param;
|
if (local.f1 != 0)
|
if (local.f1 != 0)
|
link_error ();
|
link_error ();
|
}
|
}
|
|
|
void
|
void
|
copyunion111 (testunion param)
|
copyunion111 (testunion param)
|
{
|
{
|
testunion *local = ¶m;
|
testunion *local = ¶m;
|
param.f1 = 0;
|
param.f1 = 0;
|
if (local->f1 != 0)
|
if (local->f1 != 0)
|
link_error ();
|
link_error ();
|
}
|
}
|
|
|
testunion globuf;
|
testunion globuf;
|
void
|
void
|
copyunion1111 (void)
|
copyunion1111 (void)
|
{
|
{
|
testunion local;
|
testunion local;
|
globuf.f1 = 0;
|
globuf.f1 = 0;
|
local = globuf;
|
local = globuf;
|
if (local.f1 != 0)
|
if (local.f1 != 0)
|
link_error ();
|
link_error ();
|
}
|
}
|
|
|
void
|
void
|
copyunion11111 (void)
|
copyunion11111 (void)
|
{
|
{
|
testunion *local = &globuf;
|
testunion *local = &globuf;
|
globuf.f1 = 0;
|
globuf.f1 = 0;
|
if (local->f1 != 0)
|
if (local->f1 != 0)
|
link_error ();
|
link_error ();
|
}
|
}
|
|
|
void
|
void
|
copyunion111111 (testunion param)
|
copyunion111111 (testunion param)
|
{
|
{
|
static testunion local;
|
static testunion local;
|
param.f1 = 0;
|
param.f1 = 0;
|
local = param;
|
local = param;
|
if (local.f1 != 0)
|
if (local.f1 != 0)
|
link_error ();
|
link_error ();
|
}
|
}
|
|
|
/* There should be no reference to link_error. */
|
/* There should be no reference to link_error. */
|
/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
|
/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
|
/* { dg-final { cleanup-tree-dump "optimized" } } */
|
/* { dg-final { cleanup-tree-dump "optimized" } } */
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.