OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [ext/] [dllimport7.C] - Diff between revs 149 and 154

Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} }
// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} }
//  Report errors on definition of dllimport'd static data member .
//  Report errors on definition of dllimport'd static data member .
struct Baz
struct Baz
{
{
  Baz(int a_ =0) : a(a_) {};
  Baz(int a_ =0) : a(a_) {};
  int a;
  int a;
};
};
class  __declspec(dllimport) Bar
class  __declspec(dllimport) Bar
{
{
  public:
  public:
    enum {one = 1};
    enum {one = 1};
    static const int two = 2;
    static const int two = 2;
    static const int three;
    static const int three;
    static const Baz null_baz;
    static const Baz null_baz;
};
};
const int Bar::three = 3;       //  { dg-warning "redeclared without dllimport" }
const int Bar::three = 3;       //  { dg-warning "redeclared without dllimport" }
//  { dg-error "definition of static data" "C++ specific error" { target i?86-*-cygwin* i?86-*-mingw* } 21 }
//  { dg-error "definition of static data" "C++ specific error" { target i?86-*-cygwin* i?86-*-mingw* } 21 }
const Baz Bar::null_baz;        //  { dg-warning "redeclared without dllimport" }
const Baz Bar::null_baz;        //  { dg-warning "redeclared without dllimport" }
//  { dg-error "definition of static data" "C++ specific error" { target i?86-*-cygwin* i?86-*-mingw* }  24 }
//  { dg-error "definition of static data" "C++ specific error" { target i?86-*-cygwin* i?86-*-mingw* }  24 }
int foo()
int foo()
{
{
  Bar foobar;
  Bar foobar;
  const int* baz = &Bar::two;
  const int* baz = &Bar::two;
  int a = foobar.two;
  int a = foobar.two;
  int b = foobar.three;
  int b = foobar.three;
  int c = foobar.null_baz.a;
  int c = foobar.null_baz.a;
  return (a + b + c + *baz);
  return (a + b + c + *baz);
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.