Skip to content

Commit d22ed5a

Browse files
committed
Add test and fix wording
1 parent 56adc94 commit d22ed5a

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3675,8 +3675,8 @@ getReductionType(lower::AbstractConverter &converter,
36753675

36763676
if (!isSimpleReductionType(reductionType))
36773677
TODO(converter.getCurrentLocation(),
3678-
"declare reduction using currently only supports trival types or "
3679-
"derived types containing trivial types");
3678+
"declare reduction currently only supports trival types or derived "
3679+
"types containing trivial types");
36803680
return reductionType;
36813681
}
36823682

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
! This test checks lowering of OpenMP declare reduction with non-trivial types
2+
3+
! RUN: not %flang_fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s
4+
5+
module mymod
6+
type advancedtype
7+
integer(4)::myarray(10)
8+
integer(4)::val
9+
integer(4)::otherval
10+
end type advancedtype
11+
!CHECK: not yet implemented: declare reduction currently only supports trival types or derived types containing trivial types
12+
!$omp declare reduction(myreduction: advancedtype: omp_out = omp_in) initializer(omp_priv = omp_orig)
13+
end module mymod
14+
15+
program mymaxtest
16+
use mymod
17+
18+
end program
19+

0 commit comments

Comments
 (0)