URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 338 |
// { dg-do run }
|
// { dg-do run }
|
|
|
// Copyright (C) 2003 Free Software Foundation, Inc.
|
// Copyright (C) 2003 Free Software Foundation, Inc.
|
// Contributed by Nathan Sidwell 19 Apr 2003
|
// Contributed by Nathan Sidwell 19 Apr 2003
|
|
|
// PR 9881. address-constant-expression not static initialized
|
// PR 9881. address-constant-expression not static initialized
|
|
|
struct bar {
|
struct bar {
|
double p;
|
double p;
|
}; // bar
|
}; // bar
|
|
|
bar v;
|
bar v;
|
static bool error = false;
|
static bool error = false;
|
|
|
struct foo {
|
struct foo {
|
static double *a;
|
static double *a;
|
static double *b;
|
static double *b;
|
static double storage;
|
static double storage;
|
};
|
};
|
|
|
struct baz {
|
struct baz {
|
baz () {
|
baz () {
|
if (foo::a != &v.p)
|
if (foo::a != &v.p)
|
error = true;
|
error = true;
|
if (foo::b != &foo::storage)
|
if (foo::b != &foo::storage)
|
error = true;
|
error = true;
|
}
|
}
|
};
|
};
|
|
|
baz f; // Get constructor to run before any other non-static initializers
|
baz f; // Get constructor to run before any other non-static initializers
|
|
|
double *foo::a = &(((bar *)(&v))->p);
|
double *foo::a = &(((bar *)(&v))->p);
|
double *foo::b = &(((bar *)(&foo::storage))->p);
|
double *foo::b = &(((bar *)(&foo::storage))->p);
|
double foo::storage = 0.0;
|
double foo::storage = 0.0;
|
|
|
int main() {
|
int main() {
|
return error;
|
return error;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.