summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/arm5.C
blob: 8f038d065a2f70f26163caa792145cfe96e819b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// { dg-do run  }
// GROUPS passed ARM-compliance
// arm file
// Message-Id: <9212072127.AA24243@us-es.sel.de>
// From: dcb@us-es.sel.de
// Subject: page 78 of the ARM
// Date: Mon, 7 Dec 92 22:27:09 +0100

extern "C" int printf( const char *, ...);

int & max( int & a, int & b) {
        return (a < b) ? b : a;
}

int main( void) {
        int a = 1;
        int b = 2;
        int & c = max( a, b);

        if (&c == &b)
                printf( "PASS\n");
        else
                { printf( "FAIL\n"); return 1; }
        return 0;
}