Home | History | Annotate | Download | only in jni
      1 // { dg-do run }
      2 // { dg-options "-O3" }
      3 /* PR c++/28139: disjoint alias sets for the store from
      4    expand_start_catch_block than for loading P result in P being loaded
      5    before it is initialized for sh-elf.  */
      6 
      7 extern "C" {
      8 void exit (int) __attribute__ ((noreturn));
      9 }
     10 
     11 int i_glob = 42;
     12 int *p0 = &i_glob;
     13 typedef int **ipp;
     14 
     15 void
     16 g (int i)
     17 {
     18   if (!i_glob)
     19     exit ((__SIZE_TYPE__) & i);
     20 }
     21 
     22 static void
     23 h ()
     24 {
     25   throw &p0;
     26 }
     27 
     28 int
     29 main()
     30 {
     31   g (42);
     32   try
     33     {
     34       h ();
     35     }
     36   catch (const ipp &p)
     37     {
     38       if (**p != 42)
     39         exit (1);
     40     }
     41   return 0;
     42 }
     43