libphobos/testsuite/libphobos.betterc/test19416.d
raw| 1 | /*******************************************/ |
| 2 | // https://issues.dlang.org/show_bug.cgi?id=19416 |
| 3 | |
| 4 | import core.stdc.stdlib : malloc, free; |
| 5 | import core.exception : onOutOfMemoryError; |
| 6 | |
| 7 | extern(C) void main() |
| 8 | { |
| 9 | auto m = malloc(1); |
| 10 | if (!m) |
| 11 | onOutOfMemoryError(); |
| 12 | else |
| 13 | free(m); |
| 14 | } |