2017-12-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / inline_matmul_11.f90
blob016d8d701cba13715fed11092135f7d3ddbef697
1 ! { dg-do run }
2 ! { dg-additional-options "-ffrontend-optimize -fdump-tree-optimized" }
3 ! PR fortran/66176 - inline conjg for matml.
4 program main
5 complex, dimension(3,2) :: a
6 complex, dimension(2,4) :: b, b2
7 complex, dimension(3,4) :: c,c2
8 complex, dimension(3,4) :: res1, res2, res3
10 data a/(2.,-3.),(-5.,-7.),(11.,-13.),(-17.,-19.),(23.,-29.),(-31.,-37.) /
11 data b/(41.,-43.),(-47.,-53.),(59.,-61.),(-67.,-71.),(73.,-79.),&
12 & (-83.,-89.),(97.,-101.), (-103.,-107.)/
14 data res1 / (-255.,1585.),(-3124.,72.),(-612.,2376.),(-275.,2181.), &
15 & (-4322.,202.),(-694.,3242.),(-371.,2713.),( -5408.,244.),(-944.,4012.),&
16 & (-391.,3283.),(-6664.,352.),(-1012.,4756.)/
18 data res2 / (2017.,-45.),(552.,2080.),(4428.,36.),(2789.,11.),(650.,2858.),&
19 & (6146.,182.),(3485.,3.),(860.,3548.),(7696.,232.),(4281.,49.),&
20 & (956.,4264.),(9532.,344.)/
22 c = matmul(a,b)
23 if (any(res1 /= c)) call abort
24 b2 = conjg(b)
25 c = matmul(a,conjg(b2))
26 if (any(res1 /= c)) call abort
27 c = matmul(a,conjg(b))
28 if (any(res2 /= c)) call abort
29 c = matmul(conjg(a), b)
30 if (any(conjg(c) /= res2)) call abort
31 end program main
32 ! { dg-final { scan-tree-dump-times "_gfortran_matmul" 0 "optimized" } }