Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / objc.dg / pr101666.inc
blobf1dddca6498f2d5d9d8600a216105cc511f71125
1 #include <stdlib.h>
2 struct point { double x, y, z; };
4 @interface Foo
5 - (struct point)bar;
6 - (struct point)baz;
7 @end
9 @implementation Foo
10 - (struct point)bar { struct point q = { 1.0, 2.0, 3.0 }; return q; };
11 - (struct point)baz { struct point q = { 4.0, 5.0, 6.0 }; return q; };
12 @end
14 /* Cases where a check for nil should be inserted by the compiler, when
15    -fobjc-nilcheck is in force. We should not attempt the calls, and the
16    result should be 0-filled. */
18 Foo *f;
20 int main(void) {
21   struct point p = [f bar];
22   if (p.x != 0.0 || p.y != 0.0 || p.z != 0.0)
23     abort ();
24   id nilobj = (id)0;
25   p = [nilobj baz];
26   if (p.x != 0.0 || p.y != 0.0 || p.z != 0.0)
27     abort ();
28   return 0;