brintos

brintos / llvm-project-archived public Read only

0
0
Text · 626 B · afad65b Raw
30 lines · plain
1! RUN: bbc -emit-fir -hlfir -fcuda %s -o - | FileCheck %s2 3module char14 5character*1, dimension(:), allocatable, device :: da, db6 7contains8  attributes(device) logical function check_char( c1, c2 )9    character*1, value :: c1, c210    check_char = .false.11    if(c1 .eq. c2) check_char = .true.12  end function13end module14 15program p16  use char117  integer :: n, i18  !$cuf kernel do(1)<<<*,*>>>19  do i = 1, n20    if (check_char(da(i),db(i))) then21      print*,'same'22    endif23  enddo24end program25 26! CHECK-LABEL: func.func @_QQmain()27! CHECK: cuf.kernel28! CHECK-COUNT-2: %{{.*}} = fir.alloca !fir.char<1> {bindc_name = ".tmp"}29 30