libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / split-path-10.c
blobed208795488392de60e04a1842f1c451a626b3f9
1 /* PR tree-optimization/79389 */
2 /* { dg-do compile } */
3 /* { dg-options "-O3 -fdump-tree-split-paths-details" } */
5 typedef struct
7 int m[17];
8 int seed;
9 int i;
10 int j;
11 int haveRange;
12 double left;
13 double right;
14 double width;
16 Random_struct, *Random;
18 Random new_Random_seed(int seed);
19 double Random_nextDouble(Random R);
20 void Random_delete(Random R);
22 static const int SEED = 113;
24 double MonteCarlo_integrate(int Num_samples)
28 Random R = new_Random_seed(SEED);
31 int under_curve = 0;
32 int count;
34 for (count=0; count<Num_samples; count++)
36 double x= Random_nextDouble(R);
37 double y= Random_nextDouble(R);
39 if ( x*x + y*y <= 1.0)
40 under_curve ++;
44 Random_delete(R);
46 return ((double) under_curve / Num_samples) * 4.0;
49 /* { dg-final { scan-tree-dump-times "Duplicating join block" 0 "split-paths" } } */