2 // { dg-options "-Wno-deprecated -Wreturn-type" }
7 Bug is: Urgent Code Generation Problem in gcc-i960 V 1.95
14 int printf (const char *, ...);
28 foo_parm_returns_i (foo foo_arg)
38 printf ("new foo @ 0x%x; now %d foos\n", this, si);
41 foo::foo (const foo &other)
44 printf ("another foo @ 0x%x; now %d foos\n", this, si);
51 printf ("deleted foo @ 0x%x; now %d foos\n", this, si);
58 printf ("returning 1\n");
66 printf ("returning %d\n", arg);
71 return_sum (int x, int y)
74 printf ("returning %d+%d\n", x, y);
82 printf ("returning foo\n");
87 foo_parm_returns_foo (foo f)
93 abort_because (const char *str)
95 printf ("aborting because %s\n", str);
103 printf ("returning 1\n");
104 } // { dg-warning "" } control reaches end
107 warn_return_arg (int arg)
110 printf ("returning %d\n", arg);
112 } // { dg-warning "" } control reaches end
115 warn_return_sum (int x, int y)
118 printf ("returning %d+%d\n", x, y);
120 } // { dg-warning "" } control reaches end
126 printf ("returning foo\n");
127 } // { dg-warning "" } control reaches end
130 warn_foo_parm_returns_foo (foo f)
133 } // { dg-warning "" } control reaches end
135 main () // { dg-warning "" } no type
137 int ii = return_1 ();
139 abort_because ("wrong value returned");
140 int j = return_arg (42);
142 abort_because ("wrong value returned");
143 int k = return_sum (-69, 69);
145 abort_because ("wrong value returned");
146 foo f1 = return_foo ();
148 abort_because ("wrong number of foos");
150 int l = foo_parm_returns_i (f1);
152 abort_because ("l != 5");
153 foo f2 = foo_parm_returns_foo (f1);
155 abort_because ("wrong number of foos");
157 abort_because ("f2.i != 5");
158 foo f3 = return_foo ();
160 abort_because ("wrong number of foos");