Mercurial > projects > dstress
annotate run/html_line_ending_dos.html @ 1576:b3e16c86558e
[Issue 1398] New: GDC doesn't generate correct code
<mariusmuja@gmail.com>
2007-08-04
http://d.puremagic.com/issues/show_bug.cgi?id=1398
author | thomask |
---|---|
date | Thu, 21 Feb 2008 15:20:08 +0000 |
parents | 36bedfa079e6 |
children |
rev | line source |
---|---|
11 | 1 <html> |
2 <head><title>dstress: html_line_ending_dos</title></head> | |
3 <body><pre><CODE> | |
767
8bc1fdc33e0b
fixed typos in bug_cgcs_353_*3.d and html_line_ending_dos
thomask
parents:
756
diff
changeset
|
4 // __DSTRESS_TORTURE_BLOCK__ -release |
756 | 5 |
11 | 6 int main(){ |
7 try{ | |
8 assert(0); | |
9 }catch(Exception e){ | |
10 checkLineNumber(e); | |
11 return 0; | |
12 } | |
13 | |
14 return 1; | |
15 } | |
16 | |
111 | 17 /* |
18 * @WARNING@ this code depends on the phobos implementation. | |
11 | 19 * char[]s returned by wrong assertions have to look like: |
20 * "blah blah (linenumber) blah blah" | |
21 */ | |
22 void checkLineNumber(Object o){ | |
1560 | 23 string x=o.toString(); |
111 | 24 |
11 | 25 int start; |
1560 | 26 for(start=0; start<x.length; start++){if(x[start]=='('){break;}} |
11 | 27 |
28 int end; | |
1560 | 29 for(end=x.length-1; end>start; end--){if(x[end]==')'){break;}} |
11 | 30 |
31 assert(end-start==2); | |
1560 | 32 assert(x[start+1]=='8'); |
11 | 33 } |
34 </CODE></pre></body> | |
35 </html> |