<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/154557>154557</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [flang] Incorrect SIGN= default value.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang:runtime
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          DanielCChen
      </td>
    </tr>
</table>

<pre>
    Consider the following code:
```
character*17 sign_mode
open(5, file='sign03.tmp')
inquire (5, sign=sign_mode)
close(5)
print*, sign_mode
if (sign_mode .ne. "PROCESSOR_DEFINED") ERROR STOP 1
end
```

Flang outputs `SUPPRESS`, but the standard explicitly says 
```
If this specifier is omitted in an OPEN statement that initiates a connection, the default value is PROCESSOR_DEFINED.
```

And further explains the reason being 
```
When the sign mode is PROCESSOR_DEFINED, the processor has the option of producing a plus sign or not in such positions, subject
to 13.7.2(5).
```

Because `SUPPRESS` is not subject to `13.7.2(5)`, the default value of `SIGN=` should be set to `PROCESSOR_DEFINED`. 
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxslM2O4zYQhJ-GujRWoCjTGh900PonmMvYsBPkuKDIlsWAIhX-TDJvH1C2s9jxAAYMW9VfV1dTFCHoq0VsCf9O-K4QKY7OtzthNZrtdkRb9E59tFtng1boIY4IgzPG_aPtFaRTSOqO0I6s6f1DOzkKL2RET1hXNZA7_JiyknZuRkvYCydsC4M2SOodYU1W0LqM00xYQ9iG0E7bv5P2CA9xlpB695O1qKRxAW-S_HP22kbCukfBo6seMuf_f6C0WAJh7HQ-bveXy_H8Y7c_vL7td4QxwjawP5-PZ7j8fjxBRWiHVn2akNDuYIS9gktxTjEAWdPLH6fTeX-5ZAXbQp_iElaIwirhFeC_s9FSR_MBQXwE-IR8HSCOOkCYUepBowcdwE06RlSgLQgLx9P-LfMiTmgzXUTQVkctIgYQIJ21KKN2NhvIzRUOIpkI78IkzMCnicvnyTqrYEg-jugX00LbsNA8iuAs9JhX_6nuzxHtbV59tbCk_FW7h7HZO4khOA-juMHdnI2DG_IzlWTuIWA2KdyQzoN1eV4ISY4wu6BzQVh2nfq_UEZCu-igqsumZPdD8cV431GKFPDTyrLbzL-jILos-IV1X-xzrm5YYK-_veXjvKYQRpeMgh4h4AP1HMWallCotlabeiMKbKuG84bWvK6KsW2qF479hg1steZU9Cgp1nSgDOtB9rQpdMso4_SF0Yozzl7K9apSaqiqDduItRpWZEVxEtqUxrxPpfPXQoeQsK34ivOmMKJHE5b3nrEhH2ZSdz7ZqCfMrwHfFb7Npd_6dA1kRY0OMfyERR3Ncm3cavkOXq103ufw7lH8GlNZJG_aMcY55CuDHQg7XHUcU19KNxF2yOj717fZu2Wj7LCYDoQd7r7fW_ZfAAAA__9GNnTi">