MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail58.d
blob89b2351acfe00be4227fcf8644ee7c12b74a2a6f
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail58.d(26): Error: function `fail58.SomeFunc(dchar[] pText, out int pStopPosn)` is not callable using argument types `(string, int)`
5 fail_compilation/fail58.d(26): cannot pass argument `"123"` of type `string` to parameter `dchar[] pText`
6 fail_compilation/fail58.d(30): Error: function `fail58.SomeFunc(dchar[] pText, out int pStopPosn)` is not callable using argument types `(string, int)`
7 fail_compilation/fail58.d(30): cannot pass argument `""` of type `string` to parameter `dchar[] pText`
8 ---
9 */
10 debug import std.stdio;
11 const int anything = -1000; // Line #2
12 dchar[] SomeFunc( dchar[] pText, out int pStopPosn)
14 if (pText.length == 0)
15 pStopPosn = 0;
16 else
17 pStopPosn = -1;
18 debug writefln("DEBUG: using '%s' we get %d", pText, pStopPosn);
19 return pText.dup;
22 int main(char[][] pArgs)
24 int sp;
26 SomeFunc("123", sp);
27 debug writefln("DEBUG: got %d", sp);
28 assert(sp == -1);
30 SomeFunc("", sp);
31 // if (sp != 0){} // Line #22
32 debug writefln("DEBUG: got %d", sp);
33 assert(sp == -1);
34 return 0;