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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr42462.C] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do run } */
2
 
3
#define INLINE inline __attribute__((always_inline))
4
extern "C" void abort (void);
5
 
6
template struct Foo {
7
        inline bool isFalse() { return false; }
8
        template         void f1() {}
9
        template  INLINE void f2() { f1(); }
10
        template         void f3() { f2(); }
11
        template  INLINE void f4() { f3(); }
12
        int exec2();
13
        void execute();
14
        inline void unused();
15
};
16
 
17
template inline void Foo::unused() {
18
        f4();
19
}
20
 
21
static int counter = 0;
22
 
23
template int Foo::exec2() {
24
        static void* table[2] = { &&begin, &&end };
25
        if (counter++ > 10)
26
          return 0;
27
        goto *(table[0]);
28
begin:
29
        if (isFalse()) f1();
30
end:
31
        return 1;
32
}
33
 
34
template void Foo::execute() {
35
        int r = 1;
36
        while (r) { r = exec2(); }
37
}
38
 
39
template class Foo;
40
 
41
int main() {
42
        Foo c;
43
        c.execute();
44
        if (counter < 10)
45
          abort ();
46
        return 0;
47
}

powered by: WebSVN 2.1.0

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