Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/fold-div-1.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* { dg-do compile } */ | |
2 /* { dg-options "-O1 -funsafe-math-optimizations -fdump-tree-gimple" } */ | |
3 | |
4 float f(float x) | |
5 { | |
6 return x/2 + x/3; | |
7 } | |
8 | |
9 float g(float x) | |
10 { | |
11 return 2/x + 3/x; | |
12 } | |
13 | |
14 float h(float x) | |
15 { | |
16 return x/2 - x/3; | |
17 } | |
18 | |
19 float i(float x) | |
20 { | |
21 return 2/x - 3/x; | |
22 } | |
23 | |
24 /* f and h should be turned into multiplications, | |
25 the divisions in g and i should be grouped together. */ | |
26 | |
27 /* { dg-final { scan-tree-dump-times " \\* " 2 "gimple" } } */ | |
28 /* { dg-final { scan-tree-dump-times " / " 2 "gimple" } } */ | |
29 |