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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr42357.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 compile }
2
typedef unsigned char uint8;
3
typedef unsigned int uint32;
4
class PixelARGB {
5
public:
6
    ~PixelARGB() throw() { }
7
    PixelARGB (const uint32 argb_) throw() : argb (argb_)     { }
8
    inline __attribute__((always_inline)) uint8 getRed() const throw() {
9
        return components.r;
10
    }
11
    union     {
12
        uint32 argb;
13
        struct         {
14
            uint8 b, g, r, a;
15
        } components;
16
    };
17
};
18
class Colour {
19
public:
20
    Colour() throw() : argb (0) {};
21
    uint8 getRed() const throw() {
22
        return argb.getRed();
23
    }
24
    PixelARGB argb;
25
};
26
uint8 writeImage (void) {
27
    Colour pixel;
28
    pixel = Colour ();
29
    return pixel.getRed();
30
}

powered by: WebSVN 2.1.0

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