ipa-sra: Do not remove return values needed because of non-call EH
[gcc.git] / gcc / testsuite / g++.dg / ipa / pr98690.C
1 /* { dg-do run } */
2 /* { dg-options "-O2 -fnon-call-exceptions" } */
3
4 int g;
5 volatile int v;
6
7 static int * __attribute__((noinline))
8 almost_useless_return (void)
9 {
10 v = 1;
11 return &g;
12 }
13
14 static void __attribute__((noinline))
15 foo (void)
16 {
17 int *p = almost_useless_return ();
18 int i = *p;
19 v = 2;
20 }
21
22 int
23 main (int argc, char *argv[])
24 {
25 foo ();
26 return 0;
27 }