1! { dg-do run }
2! { dg-options "-fcheck=all -std=f2008 " }
3!
4! PR fortran/49255
5!
6! Valid F2008, invalid F95/F2003.
7!
8integer,pointer :: ptr => null()
9call foo (ptr)
10contains
11  subroutine foo (x)
12    integer, optional :: x
13    if (present (x)) STOP 1
14  end subroutine foo
15end
16