brintos

brintos / llvm-project-archived public Read only

0
0
Text · 941 B · 3c9ee73 Raw
25 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! CUDA Fortran section 2.5.6 restrictions3module m4 contains5  attributes(device) subroutine devsubr(n)6    integer, intent(in) :: n7    !WARNING: 'x1' should not have the SAVE attribute or initialization in a device subprogram [-Wcuda-usage]8    real, save :: x19    !WARNING: 'x2' should not have the SAVE attribute or initialization in a device subprogram [-Wcuda-usage]10    real :: x2 = 1.11    !ERROR: Device subprogram 'devsubr' cannot call itself12    if (n > 0) call devsubr(n-1)13  end subroutine14  attributes(global) subroutine globsubr15  end subroutine16  subroutine boring17  end subroutine18  subroutine test19    !ERROR: 'globsubr' is a kernel subroutine and must be called with kernel launch parameters in chevrons20    call globsubr21    !ERROR: Kernel launch parameters in chevrons may not be used unless calling a kernel subroutine22    call boring<<<1,2>>>23  end subroutine24end module25