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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.dg/] [ext/] [asmspecValid.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// tests that the asm directive is correctly handled for static fields
2
// in structures and classes.  This only applies to C++; such
3
// directives generate errors in C.  Assembler directives for local
4
// variables should be tested by the C test suite.
5
//
6
// Contributed by Robert Bowdidge (bowdidge@apple.com) 14 Oct 2003
7
 
8
// { dg-do compile }
9
 
10
struct Foo {
11
  // This should reference a variable called bar
12
  static int i __asm__("bar");
13
};
14
 
15
 
16
class Bar {
17
public:
18
  static int i __asm__("theRealI");
19
  static int j __asm__("theRealJ");
20
  int boof;
21
};
22
 
23
class Baz : public Bar {
24
public:
25
   static char *ptr __asm__ ("theRealString");
26
};
27
 
28
int main (int argc, char **argv) {
29
  struct Foo myFoo;
30
  Bar b;
31
  myFoo.i = 1;
32
  Foo::i = 2;
33
  Baz::j = 10;
34
  Baz::ptr = 0;
35
  b.i = 1;
36
  return (b.i);
37
}
38
 
39
 
40
/* { dg-final {scan-assembler "bar"} } */
41
/* { dg-final {scan-assembler "theRealString"} } */
42
/* { dg-final {scan-assembler "theRealI" } } */
43
/* { dg-final {scan-assembler "theRealJ" } } */

powered by: WebSVN 2.1.0

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