annotate run/e/extern_10_B.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 bfebb405f3ed
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1442
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
1 // $HeadURL$
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
2 // $Date$
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
3 // $Author$
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
4
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
5 // @author@ Thomas Kühne <thomas-dloop@kuehne.cn>
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
6 // @date@ 2007-02-13
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=957
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
8 // @desc@ [Issue 957] linkage attributes for function level declarations are ignored
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
9
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
10 module dstress.run.e.extern_10_B;
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
11
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
12 extern(Pascal) long foo(int a, int b){
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
13 return (a + 1) * b;
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
14 }
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
15
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
16 extern(Pascal) long function(int, int) bar;
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
17
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
18 int main(){
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
19 bar = &foo;
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
20
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
21 if(20 != bar(3, 5)){
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
22 assert(0);
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
23 }
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
24
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
25 return 0;
bfebb405f3ed r7390@birke: tk | 2007-03-29 16:07:56 +0200
thomask
parents:
diff changeset
26 }