[AMDGPU] Test codegen'ing True16 additions.
[llvm-project.git] / flang / test / Semantics / cuf02.cuf
blob38b3e783d86b3a49bc9c601f5ac68cc8ac707a0a
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 module m
3   interface
4     !ERROR: An ATTRIBUTES(DEVICE) subprogram must be a top-level module procedure
5     attributes(device) subroutine exts1
6     end
7   end interface
8  contains
9   !ERROR: A device subprogram may not be RECURSIVE, PURE, or ELEMENTAL
10   recursive attributes(device) subroutine s1
11   end
12   !ERROR: A device subprogram may not be RECURSIVE, PURE, or ELEMENTAL
13   pure attributes(device) subroutine s2
14   end
15   !ERROR: A device subprogram may not be RECURSIVE, PURE, or ELEMENTAL
16   elemental attributes(device) subroutine s3
17   end
18   subroutine s4
19    contains
20     !ERROR: A device subprogram may not be an internal subprogram
21     attributes(device) subroutine inner
22     end
23   end
24   attributes(device) subroutine s5 ! nvfortran crashes on this one
25    contains
26     !ERROR: 'inner' may not be an internal procedure of CUDA device subprogram 's5'
27     subroutine inner
28     end
29   end
30   attributes(device) subroutine s6
31     stmtfunc(x) = x + 1. ! ok
32   end
33   !ERROR: A function may not have ATTRIBUTES(GLOBAL) or ATTRIBUTES(GRID_GLOBAL)
34   attributes(global) real function f1
35   end
36   !ERROR: A device subprogram may not be RECURSIVE, PURE, or ELEMENTAL
37   recursive attributes(global) subroutine s7
38   end
39   !ERROR: A device subprogram may not be RECURSIVE, PURE, or ELEMENTAL
40   pure attributes(global) subroutine s8
41   end
42   !ERROR: A device subprogram may not be RECURSIVE, PURE, or ELEMENTAL
43   elemental attributes(global) subroutine s9
44   end
45 end
47 !ERROR: An ATTRIBUTES(DEVICE) subprogram must be a top-level module procedure
48 attributes(device) subroutine exts1
49 end