[AArch64] SVE tests
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / eh_return.c
blob32179488085ed4c84aa77007565c875d09c4197c
1 /* { dg-do run } */
2 /* { dg-options "-O2 -fno-inline" } */
4 #include <stdlib.h>
5 #include <stdio.h>
7 int val, test, failed;
9 int main (void);
11 void
12 eh0 (void *p)
14 val = (int)(long)p & 7;
15 if (val)
16 abort ();
19 void
20 eh1 (void *p, int x)
22 void *q = __builtin_alloca (x);
23 eh0 (q);
24 __builtin_eh_return (0, p);
27 void
28 eh2a (int a,int b,int c,int d,int e,int f,int g,int h, void *p)
30 val = a + b + c + d + e + f + g + h + (int)(long)p & 7;
33 void
34 eh2 (void *p)
36 eh2a (val, val, val, val, val, val, val, val, p);
37 __builtin_eh_return (0, p);
41 void
42 continuation (void)
44 test++;
45 main ();
48 void
49 fail (void)
51 failed = 1;
52 printf ("failed\n");
53 continuation ();
56 void
57 do_test1 (void)
59 if (!val)
60 eh1 (continuation, 100);
61 fail ();
64 void
65 do_test2 (void)
67 if (!val)
68 eh2 (continuation);
69 fail ();
72 int
73 main (void)
75 if (test == 0)
76 do_test1 ();
77 if (test == 1)
78 do_test2 ();
79 if (failed || test != 2)
80 exit (1);
81 exit (0);