37 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12 3module mod14contains5 attributes(global) subroutine sub1(adev)6 real :: adev(10)7 integer :: tid8 tid = threadIdx%x9! Use to crash the compiler. Make sure we have the proper semantic error.10!ERROR: Actual argument for 'i=' has bad type 'REAL(4)'11 adev(tid + 1) = scale(real(tid), 2.0) 12 end subroutine sub113end module14 15subroutine sub1()16 real, device :: adev(10), bdev(10)17 real :: ahost(10)18 19!ERROR: More than one reference to a CUDA object on the right hand side of the assignment20 ahost = adev + bdev21 22 ahost = adev + adev23 24end subroutine25 26logical function compare_h(a,b)27!ERROR: Derived type 'h' not found28 type(h) :: a, b29!ERROR: 'a' is not an object of derived type; it is implicitly typed30!ERROR: 'b' is not an object of derived type; it is implicitly typed31 compare_h = (a%h .eq. b%h)32end33 34attributes(global) subroutine sub2()35 if (threadIdx%x == 1) print *, "I'm number one"36end subroutine37