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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2" } */
3
 
4
extern "C" void abort (void);
5
enum SbxDataType { SbxINTEGER, SbxDECIMAL, SbxBYREF = 0x4000 };
6
struct SbxValues {
7
    union {
8
        float nSingle;
9
        float* pSingle;
10
    };
11
    SbxDataType eType;
12
};
13
static bool ImpPutDoubleFoo( SbxValues* p)
14
{
15
    bool bRet = false;
16
    SbxValues aTmp;
17
    int count = 0;
18
start:
19
    switch( p->eType )  {
20
        case SbxINTEGER:
21
            if (count++ > 0)
22
              abort ();
23
            aTmp.pSingle = &p->nSingle; goto direct;
24
        case SbxBYREF | SbxDECIMAL:
25
            bRet = false;
26
            break;
27
        direct:
28
            aTmp.eType = SbxDataType( p->eType | SbxBYREF );
29
            p = &aTmp; goto start;
30
        case SbxBYREF | SbxINTEGER:
31
            break;
32
        default:
33
            bRet =true;
34
    }
35
    return bRet;
36
}
37
 
38
int main( int argc, char** argv )
39
{
40
    SbxValues aTmp;
41
    aTmp.eType = SbxINTEGER;
42
    if ( ImpPutDoubleFoo( &aTmp ) )
43
        abort ();
44
    return 0;
45
}

powered by: WebSVN 2.1.0

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