coarray_41.f90: Add "-latomic" option if libatomic_available.
[official-gcc.git] / gcc / testsuite / gfortran.dg / warn_function_without_result.f90
blob43af9c9ca10d6ab3ebdd7b426071d0fe7af5ab1b
1 ! { dg-do compile }
2 ! { dg-options "-Wreturn-type" }
4 ! PR fortran/31463 - inconsistent warnings if function return value is not set
5 ! PR fortran/33950 - Warning missing for function result not set
6 ! PR fortran/34296 - Intent(out) and character functions with RESULT: Value-not-set warning
8 FUNCTION f1() ! { dg-warning "not set" }
9 REAL :: f1
10 END FUNCTION
12 FUNCTION f2() ! { dg-warning "not set" }
13 REAL, DIMENSION(1) :: f2
14 END FUNCTION
16 FUNCTION f3() ! { dg-warning "not set" }
17 REAL, POINTER :: f3
18 END FUNCTION
20 FUNCTION f4() ! { dg-warning "not set" }
21 REAL, DIMENSION(:), POINTER :: f4
22 END FUNCTION
24 FUNCTION f5() ! { dg-warning "not set" }
25 REAL, DIMENSION(:), ALLOCATABLE :: f5
26 END FUNCTION
28 FUNCTION f6() ! { dg-warning "not set" }
29 CHARACTER(2) :: f6
30 END FUNCTION
34 FUNCTION g1() RESULT(h) ! { dg-warning "not set" }
35 REAL :: h
36 END FUNCTION
38 FUNCTION g2() RESULT(h) ! { dg-warning "not set" }
39 REAL, DIMENSION(1) :: h
40 END FUNCTION
42 FUNCTION g3() RESULT(h) ! { dg-warning "not set" }
43 REAL, POINTER :: h
44 END FUNCTION
46 FUNCTION g4() RESULT(h) ! { dg-warning "not set" }
47 REAL, DIMENSION(:), POINTER :: h
48 END FUNCTION
50 FUNCTION g5() RESULT(h) ! { dg-warning "not set" }
51 REAL, DIMENSION(:), ALLOCATABLE :: h
52 END FUNCTION
54 FUNCTION g6() RESULT(h) ! { dg-warning "not set" }
55 CHARACTER(2) :: h
56 END FUNCTION