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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [ext/] [dllimport7.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw* x86_64-*-mingw* } }
2
 
3
//  Report errors on definition of dllimport'd static data member .
4
 
5
 
6
struct Baz
7
{
8
  Baz(int a_ =0) : a(a_) {}
9
  int a;
10
};
11
 
12
class  __declspec(dllimport) Bar
13
{
14
  public:
15
    enum {one = 1};
16
    static const int two = 2;
17
    static const int three;
18
    static const Baz null_baz;
19
};
20
 
21
const int Bar::three = 3;       //  { dg-warning "redeclared without dllimport" }
22
//  { dg-error "definition of static data" "C++ specific error" { target i?86-*-cygwin* i?86-*-mingw* x86_64-*-mingw* } 21 }
23
 
24
const Baz Bar::null_baz;        //  { dg-warning "redeclared without dllimport" }
25
 
26
int foo()
27
{
28
  Bar foobar;
29
  const int* baz = &Bar::two;
30
  int a = foobar.two;
31
  int b = foobar.three;
32
  int c = foobar.null_baz.a;
33
  return (a + b + c + *baz);
34
}

powered by: WebSVN 2.1.0

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