1! { dg-do compile }
2! { dg-options "-std=gnu" }
3!
4! Tests the fix for PR30237 in which alternate returns in intrinsic
5! actual arglists were quietly ignored.
6!
7! Contributed by Brooks Moses <brooks@gcc.gnu.org>
8!
9program ar1
10    interface random_seed
11      subroutine x (a, *)
12        integer a
13      end subroutine x
14    end interface random_seed
15
16    real t1(2)
17    call cpu_time(*20)        ! { dg-error "not permitted" }
18    call cpu_time(*20, t1(1)) ! { dg-error "Too many arguments" }
19! This specific version is permitted by the generic interface.
20    call random_seed(i, *20)
21! The new error gets overwritten but the diagnostic is clear enough.
22    call random_seed(i, *20, *30) ! { dg-error "not consistent" }
23    stop
2420  write(*,*) t1
2530 stop
26end
27