Mercurial > projects > ldc
annotate tests/mini/bug308_double_finally.d @ 1650:40bd4a0d4870
Update to work with LLVM 2.7.
Removed use of dyn_cast, llvm no compiles
without exceptions and rtti by
default. We do need exceptions for the libconfig stuff, but rtti isn't
necessary (anymore).
Debug info needs to be rewritten, as in LLVM 2.7 the format has
completely changed. To have something to look at while rewriting, the
old code has been wrapped inside #ifndef DISABLE_DEBUG_INFO , this means
that you have to define this to compile at the moment.
Updated tango 0.99.9 patch to include updated EH runtime code, which is
needed for LLVM 2.7 as well.
author | Tomas Lindquist Olsen |
---|---|
date | Wed, 19 May 2010 12:42:32 +0200 |
parents | f9285cf14c0d |
children |
rev | line source |
---|---|
1413
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
1 extern(C) int printf(char*, ...); |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
2 |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
3 long foo(ref int p) { |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
4 try { return 0; } |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
5 finally { |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
6 p++; |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
7 throw new Object; |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
8 } |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
9 } |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
10 |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
11 void main() { |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
12 int p = 0; |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
13 try { |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
14 foo(p); |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
15 assert(0); |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
16 } catch { |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
17 } |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
18 printf("Number of types scope(exit) was executed : %d\n", p); |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
19 assert(p == 1); |
f9285cf14c0d
Add test from #308 to minitests.
Christian Kamm <kamm incasoftware de>
parents:
diff
changeset
|
20 } |