102 lines · plain
1! REQUIRES: plugins, examples, shell2 3!RUN: %flang_fc1 -load %llvmshlibdir/flangOmpReport%pluginext -plugin flang-omp-report -fopenmp %s -o - | FileCheck %s4 5! Check OpenMP clause validity for the following directives:6! 2.10 Device constructs7program main8 9 real(8) :: arrayA(256), arrayB(256)10 integer :: N11 12 arrayA = 1.41413 arrayB = 3.1414 N = 25615 16 !$omp target map(arrayA)17 do i = 1, N18 a = 3.1419 enddo20 !$omp end target21 22 !$omp target device(0)23 do i = 1, N24 a = 3.1425 enddo26 !$omp end target27 28 !$omp target defaultmap(tofrom:scalar)29 do i = 1, N30 a = 3.1431 enddo32 !$omp end target33 34 !$omp teams num_teams(3) thread_limit(10) default(shared) private(i) shared(a)35 do i = 1, N36 a = 3.1437 enddo38 !$omp end teams39 40 !$omp target map(tofrom:a)41 do i = 1, N42 a = 3.1443 enddo44 !$omp end target45 46 !$omp target data device(0) map(to:a)47 do i = 1, N48 a = 3.1449 enddo50 !$omp end target data51 52end program main53 54! CHECK: ---55! CHECK-NEXT: - file: '{{[^"]*}}omp-device-constructs.f90'56! CHECK-NEXT: line: 1657! CHECK-NEXT: construct: target58! CHECK-NEXT: clauses:59! CHECK-NEXT: - clause: map60! CHECK-NEXT: details: arraya61! CHECK-NEXT: - file: '{{[^"]*}}omp-device-constructs.f90'62! CHECK-NEXT: line: 2263! CHECK-NEXT: construct: target64! CHECK-NEXT: clauses:65! CHECK-NEXT: - clause: device66! CHECK-NEXT: details: '0'67! CHECK-NEXT: - file: '{{[^"]*}}omp-device-constructs.f90'68! CHECK-NEXT: line: 2869! CHECK-NEXT: construct: target70! CHECK-NEXT: clauses:71! CHECK-NEXT: - clause: defaultmap72! CHECK-NEXT: details: 'tofrom:scalar'73! CHECK-NEXT: - file: '{{[^"]*}}omp-device-constructs.f90'74! CHECK-NEXT: line: 3475! CHECK-NEXT: construct: teams76! CHECK-NEXT: clauses:77! CHECK-NEXT: - clause: default78! CHECK-NEXT: details: shared79! CHECK-NEXT: - clause: num_teams80! CHECK-NEXT: details: '3'81! CHECK-NEXT: - clause: private82! CHECK-NEXT: details: i83! CHECK-NEXT: - clause: shared84! CHECK-NEXT: details: a85! CHECK-NEXT: - clause: thread_limit86! CHECK-NEXT: details: '10'87! CHECK-NEXT: - file: '{{[^"]*}}omp-device-constructs.f90'88! CHECK-NEXT: line: 4089! CHECK-NEXT: construct: target90! CHECK-NEXT: clauses:91! CHECK-NEXT: - clause: map92! CHECK-NEXT: details: 'tofrom:a'93! CHECK-NEXT: - file: '{{[^"]*}}omp-device-constructs.f90'94! CHECK-NEXT: line: 4695! CHECK-NEXT: construct: target data96! CHECK-NEXT: clauses:97! CHECK-NEXT: - clause: device98! CHECK-NEXT: details: '0'99! CHECK-NEXT: - clause: map100! CHECK-NEXT: details: 'to:a'101! CHECK-NEXT: ...102