URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Subversion Repositories openrisc_2011-10-31
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [net2.C] - Rev 154
Compare with Previous | Blame | View Log
// { dg-do run }
// Test of various ?: problems.
class D
{
public:
void a();
void b();
D(int i):x(i) {}
private:
int x;
};
void D::a() {++x;}
void D::b() {--x;}
int aa=1, bb=0;
int fa() {return 0;}
int fb() {return 2;}
int main(int argc, char* argv[])
{
typedef int* pi;
int* p = (argc == 1)? &aa: &bb;
*p = 0;
typedef int (*ifptr)();
ifptr fp = (argc == 1)? fa: fb;
aa = fp();
D d(0);
typedef void (D::*dmem)();
dmem mfp = (argc == 1)? &D::a: &D::b;
(d.*mfp)();
return 0;
}