mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-05-06 02:11:30 +02:00
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
This commit is contained in:
27
tests/mini/throw1.d
Normal file
27
tests/mini/throw1.d
Normal file
@@ -0,0 +1,27 @@
|
||||
module throw1;
|
||||
|
||||
extern(C) int rand();
|
||||
|
||||
class C
|
||||
{
|
||||
}
|
||||
|
||||
void func(bool b)
|
||||
{
|
||||
if (b)
|
||||
throw new C;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
bool b = true;
|
||||
try
|
||||
{
|
||||
func(b);
|
||||
}
|
||||
catch(Object)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
Reference in New Issue
Block a user