mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00

* Fix issue 24174 - [CTFE] goto within with statements & catch blocks cause a infinite loop * Remove main from test compileable/issue24174.d
36 lines
525 B
D
36 lines
525 B
D
/* TEST_OUTPUT:
|
|
---
|
|
true
|
|
false
|
|
---
|
|
*/
|
|
|
|
bool func1() {
|
|
struct BtMatcher {
|
|
uint pc = 0;
|
|
}
|
|
BtMatcher matcher;
|
|
with (matcher) {
|
|
goto StartLoop;
|
|
StartLoop:
|
|
goto SecondLabel;
|
|
SecondLabel:
|
|
return true;
|
|
}
|
|
}
|
|
|
|
bool func2() {
|
|
try {
|
|
throw new Exception("a");
|
|
return true;
|
|
} catch (Exception e) {
|
|
goto StartA;
|
|
StartA:
|
|
goto StartB;
|
|
StartB:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
pragma(msg, func1());
|
|
pragma(msg, func2());
|