Mercurial > projects > dstress
annotate run/bug_20041103_D.d @ 1630:d0efa3ae5522 default tip
run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author | David Nadlinger <code@klickverbot.at> |
---|---|
date | Sat, 23 Apr 2011 22:57:32 +0200 |
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_D; |
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 int rot13_c(int 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 int 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 } |