[llvm][Docs] Update supported hardware (#121743)
[llvm-project.git] / flang / test / Semantics / random-seed.f90
blob9ad2a2544bedf1d7308d957bd22502e005dfb75d
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! NULL() intrinsic function error tests
3 program test_random_seed
4 integer :: size_arg
5 integer, parameter :: size_arg_const = 343
6 integer, dimension(3), parameter :: put_arg = [9,8,7]
7 integer :: get_arg_scalar
8 integer, dimension(3) :: get_arg
9 integer, dimension(3),parameter :: get_arg_const = [8,7,6]
10 call random_seed()
11 call random_seed(size_arg)
12 call random_seed(size=size_arg)
13 !ERROR: Actual argument associated with INTENT(OUT) dummy argument 'size=' is not definable
14 !BECAUSE: '343_4' is not a variable or pointer
15 call random_seed(size_arg_const) ! error, size arg must be definable
16 !ERROR: 'size=' argument has unacceptable rank 1
17 call random_seed([1, 2, 3, 4]) ! Error, must be a scalar
18 call random_seed(put = [1, 2, 3, 4])
19 call random_seed(put = put_arg)
20 !ERROR: 'size=' argument has unacceptable rank 1
21 call random_seed(get_arg) ! Error, must be a scalar
22 call random_seed(get=get_arg)
23 !ERROR: 'get=' argument has unacceptable rank 0
24 call random_seed(get=get_arg_scalar) ! Error, GET arg must be of rank 1
25 !ERROR: Actual argument associated with INTENT(OUT) dummy argument 'get=' is not definable
26 !BECAUSE: '[INTEGER(4)::8_4,7_4,6_4]' is not a variable or pointer
27 call random_seed(get=get_arg_const) ! Error, GET arg must be definable
28 !ERROR: RANDOM_SEED must have either 1 or no arguments
29 call random_seed(size_arg, get_arg) ! Error, only 0 or 1 argument
30 end program