minit ("OR", INTRINSIC_OR),
minit ("EQV", INTRINSIC_EQV),
minit ("NEQV", INTRINSIC_NEQV),
- minit ("==", INTRINSIC_EQ),
+ minit ("EQ_SIGN", INTRINSIC_EQ),
minit ("EQ", INTRINSIC_EQ_OS),
- minit ("/=", INTRINSIC_NE),
+ minit ("NE_SIGN", INTRINSIC_NE),
minit ("NE", INTRINSIC_NE_OS),
- minit (">", INTRINSIC_GT),
+ minit ("GT_SIGN", INTRINSIC_GT),
minit ("GT", INTRINSIC_GT_OS),
- minit (">=", INTRINSIC_GE),
+ minit ("GE_SIGN", INTRINSIC_GE),
minit ("GE", INTRINSIC_GE_OS),
- minit ("<", INTRINSIC_LT),
+ minit ("LT_SIGN", INTRINSIC_LT),
minit ("LT", INTRINSIC_LT_OS),
- minit ("<=", INTRINSIC_LE),
+ minit ("LE_SIGN", INTRINSIC_LE),
minit ("LE", INTRINSIC_LE_OS),
minit ("NOT", INTRINSIC_NOT),
minit ("PARENTHESES", INTRINSIC_PARENTHESES),
--- /dev/null
+! { dg-do run }
+! PR fortran/33941
+! The problem was that the intrinsic operators
+! were written to the module file as '/=' etc.
+! but this format was not understood on reading.
+!
+! Test case by Toby White, stripped down by
+! Dominique d'Humieres and Francois-Xavier Coudert
+
+module foo
+contains
+ function pop(n) result(item)
+ integer :: n
+ character(len=merge(1, 0, n > 0)) :: item
+ end function pop
+ function push(n) result(item)
+ integer :: n
+ character(len=merge(1, 0, n /= 0)) :: item
+ end function push
+end module foo
+
+program test
+ use foo
+ if(len(pop(0)) /= 0) call abort()
+ if(len(pop(1)) /= 1) call abort()
+ if(len(push(0)) /= 0) call abort()
+ if(len(push(1)) /= 1) call abort()
+end program
+! { dg-final { cleanup-modules "foo" } }