Skip to content

Commit 238c27b

Browse files
committed
fixup: Add test to ensure malloc is not called
1 parent e07d186 commit 238c27b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
! RUN: %flang_fc1 -emit-llvm -fopenmp -o - -x f95 %s | FileCheck %s
2+
3+
subroutine foo(state,ilast,jlast,vals)
4+
real, intent(in) :: state(:,:)
5+
integer, intent(in) :: ilast, jlast
6+
real, intent( out) :: vals(:,:)
7+
8+
real :: bar(4)
9+
integer :: i,k,ll,s
10+
11+
!$omp target teams distribute parallel do private(bar)
12+
do i = 1, ilast
13+
do j = 1, jlast
14+
do s = 1, 4
15+
bar(s) = state(i,j+s)
16+
enddo
17+
vals(i,j) = -bar(1)/12 + 7*bar(2)/12 + 7*bar(3)/12 - bar(4)/12
18+
enddo
19+
enddo
20+
!$omp end target teams distribute parallel do
21+
end subroutine foo
22+
23+
! Ensure that we do not generate a call to malloc
24+
!CHECK-LABEL: omp.private.init:
25+
!CHECK-NOT: call {{.*}} @malloc
26+
!CHECK: br label
27+

0 commit comments

Comments
 (0)