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

    <tr>
        <th>Summary</th>
        <td>
            [mlir] OptionalProp<IntProp<uint8_t>> printout empty for 0 and similar values.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            mlir
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          peledins-zimperium
      </td>
    </tr>
</table>

<pre>
    We have in our op:

```
arguments = (ins OptionalProp<IntProp<"uint8_t">>:$stuff)
...
let assemblyFormat = [{
 $op (`stuff` $stuff^)?
    }];
```

When serializing this for `stuff==0` we get printout of 
```
stuff
```

In generated code:
` _odsPrinter << (*(getProperties().stuff));`
which maps to:
```
 raw_ostream &operator<<(unsigned char C) {
    if (OutBufCur >= OutBufEnd)
 return write(C);
    *OutBufCur++ = C;
    return *this;
 }
```

So it ends up printing \0 instead of 0.

uint16_t works, int8_t does not.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx0U02L5DgM_TXKRXRwnO9DDqmqLpjTDOxhjo0rUSXedezgjyp6fv3iJFsNMywYEoT0JL2nJ5yTkybqoDxBeUlE8LOx3UqKRqnd2y-5rGRlWJKbGT-7n4SzeBBKjSZYNCvkPbDtVex4rBd2Cgtp7xDyCwJvpHb4ffXSaKF-2Fh1_qb98QecB6l98-GBc8jft9cDL5wP9zvwFlifpimwXpFH4RwtN_V5NXYRfm9QnqA-AesReGHW2BAqtldXDF9I5XsEy68xExGhvkB5gfz02_TA-p8zaXRkpVDyl9QT-lk6vBuLL-D8AvklVuCTcCKPq5Xam-DR3PE3xL3ijy7fNE6kyQpPIw5mpIPMiuGHGd2PCEgWI0X5eduK98CbiTbmyHpJbou26YuquOBp7_Cc5TDjIlaH3rygXwOgFc8P47wlsSDwKiIKb-zeDngT9HYaIw6zsHgG3uJBMyLKexzoe_CncD-HOOR7lGIPvOtxlw0t-WA1Pq30BLw5H_MdAvD-BQD8BPy0yXn-yjjKgfdRgCMedfuDy78MSo-kR4dh3bWIukF5Zii18yTGKAxL9_R4cFn14fFp7D8O-Bn3C8TRkENtfJqMXT62eSsS6rK6ZAUrm4onczeUQ9a2eTUUTVk02ThmeVvzWynyWtRNkyWy44yXrOKM1WXGeDrUWSHuWV3TjbEh51AwWoRUqVKPJTV2SqRzgbqsKNo2T5S4kXKbITlflLTRFuUlsV3Mf7uFyUHBlHTefSF46dVm4q2gvPy_3f7z2ma0r6ulZfWf24kzFHpEJxephMWHUIFcmgSrutn71W3evAK_TtLP4ZYOZgF-jYMcn7fVmr9p8MCv214O-PVY7dHxfwMAAP__0apRhQ">