Add an UNSPEC_PROLOGUE_USE to prevent the link register from being considered dead.
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.law / temps6.C
blob5290df072c3fff145f67aca5b082fe221dd7f3d5
1 // GROUPS passed temps
2 // Date: Tue, 22 Mar 94 12:46:28 +0100
3 // From: dak@pool.informatik.rwth-aachen.de
4 // Message-Id: <9403221146.AA07815@messua>
5 // Subject: Bad code for pointer to member use as reference in g++ 2.5.8
7 #include <stdio.h>
8 struct str {
9   int i;
10 } xxx = {0};
12 int& test(str *arg1, int str::*arg2)
14   return (arg1->*arg2);
17 int main()
19   test(&xxx, &str::i) = 5;
20   if (xxx.i == 0)
21     { printf ("FAIL\n"); return 1; }
22   else
23     printf ("PASS\n");