annotate nocompile/bug_20041103_C.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 20d8ee6523e1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
349
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
1 // $HeadURL$
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
2 // $Date$
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
3 // $Author$
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
4
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
5 // @author@ kinghajj <kinghajj_member@pathlink.com>
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
6 // @date@ 2004-10-03
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
7 // @uri@ news:cm98hu$e30$1@digitaldaemon.com
1383
52c9e86b6486 @url@ -> @uri@
thomask
parents: 349
diff changeset
8 // @uri@ nntp://digitalmars.com/digitalmars.D/12248
349
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
9
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
10 // __DSTRESS_ELINE__ 28
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
11
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
12 module dstress.nocompile.bug_20041103_C;
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
13
1535
20d8ee6523e1 updated to DMD-1.013
thomask
parents: 1383
diff changeset
14 char rot13_c(ref char ret){
349
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
15 if(ret > 'A'-1 && ret < 'N'){
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
16 ret += 13;
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
17 }else if(ret > 'M' && ret < 'Z'+1){
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
18 ret -= 13;
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
19 }else if(ret > 'a'-1 && ret < 'n'){
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
20 ret += 13;
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
21 }else if(ret > 'm' && ret < 'z'+1){
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
22 ret -= 13;
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
23 }
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
24 return ret;
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
25 }
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
26
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
27 int main(){
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
28 char c = rot13_c('A');
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
29 assert(c=='A'+13);
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
30 return 0;
fbce829583df attempt to pass a literal as an argument that should be a reference
thomask
parents:
diff changeset
31 }