Mercurial > projects > dstress
annotate run/bug_20041103_A.d @ 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 | ec5e144583ea |
children |
rev | line source |
---|---|
140 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
98
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
5 // @author@ kinghajj <kinghajj_member@pathlink.com> |
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
6 // @date@ 2004-10-03 |
140 | 7 // @uri@ news:cm98hu$e30$1@digitaldaemon.com |
1383 | 8 // @uri@ nntp://digitalmars.com/digitalmars.D/12248 |
98
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
9 |
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
10 module dstress.run.bug_20041103_A; |
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
11 |
1559 | 12 char rot13_c(char ret){ |
98
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
13 if(ret > 'A'-1 && ret < 'N'){ |
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
14 ret += 13; |
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
15 }else if(ret > 'M' && ret < 'Z'+1){ |
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
16 ret -= 13; |
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
17 }else if(ret > 'a'-1 && ret < 'n'){ |
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
18 ret += 13; |
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
19 }else if(ret > 'm' && ret < 'z'+1){ |
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
20 ret -= 13; |
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
21 } |
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
22 return ret; |
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
23 } |
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
24 |
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
25 int main(){ |
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
26 char c = rot13_c('A'); |
1559 | 27 if('A'+13 != c){ |
28 assert(0); | |
29 } | |
98
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
30 return 0; |
75e0c2f6231e
kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff
changeset
|
31 } |