Mercurial > projects > dstress
annotate run/return_06.d @ 322:0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
Walter <walter@digitalmars.com>
2005-03-17
mail:000d01c52b1d$0cd44110$0200a8c0@colossus
author | thomask |
---|---|
date | Thu, 17 Mar 2005 21:37:29 +0000 |
parents | |
children | 9a121126b077 |
rev | line source |
---|---|
322
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
1 // $HeadURL$ |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
2 // $Date$ |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
3 // $Author$ |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
4 |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
5 // path without return |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
6 |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
7 module dstress.run.return_06; |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
8 |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
9 int test(int i){ |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
10 if(i==0){ |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
11 return 2; |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
12 } |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
13 } |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
14 |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
15 int main(){ |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
16 assert(test(0)==2); |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
17 try{ |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
18 test(1); |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
19 }catch{ |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
20 return 0; |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
21 } |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
22 assert(0); |
0c38b6a3aab2
paths without return statements are specifically allowed, the compiler has to insert an assert(0)
thomask
parents:
diff
changeset
|
23 } |