URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 384 |
// Report error if dllimport attribute in definition itself.
|
// Report error if dllimport attribute in definition itself.
|
// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} }
|
// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} }
|
|
|
__attribute__((dllimport)) void bar () { } // { dg-error "definition" }
|
__attribute__((dllimport)) void bar () { } // { dg-error "definition" }
|
|
|
__attribute__((dllimport)) int foo = 1; // { dg-error "definition" }
|
__attribute__((dllimport)) int foo = 1; // { dg-error "definition" }
|
|
|
void faz()
|
void faz()
|
{
|
{
|
__attribute__((dllimport)) int faa = 1; // { dg-error "definition" }
|
__attribute__((dllimport)) int faa = 1; // { dg-error "definition" }
|
faa++;
|
faa++;
|
}
|
}
|
|
|
__attribute__((dllimport)) int fee (1); // { dg-error "definition" }
|
__attribute__((dllimport)) int fee (1); // { dg-error "definition" }
|
|
|
|
|
// In-class initialization of a static data member is not a definition.
|
// In-class initialization of a static data member is not a definition.
|
struct F
|
struct F
|
{
|
{
|
__attribute__ ((dllimport)) static const int i = 1; // OK
|
__attribute__ ((dllimport)) static const int i = 1; // OK
|
};
|
};
|
|
|
// Reference the dllimport'd static data member.
|
// Reference the dllimport'd static data member.
|
void f ()
|
void f ()
|
{
|
{
|
const int* j = &F::i;
|
const int* j = &F::i;
|
}
|
}
|
|
|
struct G
|
struct G
|
{
|
{
|
__attribute__ ((dllimport)) static const int i = 1;
|
__attribute__ ((dllimport)) static const int i = 1;
|
};
|
};
|
|
|
// Define the static data member _without_ the dllimport.
|
// Define the static data member _without_ the dllimport.
|
// This should override the prior declaration with dllimport.
|
// This should override the prior declaration with dllimport.
|
|
|
const int G::i; // { dg-warning "dllimport ignored" }
|
const int G::i; // { dg-warning "dllimport ignored" }
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.