Mercurial > projects > ldc
view test/vararg1.d @ 205:9d44ec83acd1 trunk
[svn r221] Update: Switched to the 2.3 LLVM svn branch, http://llvm.org/svn/llvm-project/llvm/branches/release_23 .
Fixed: Implemented volatile statements. Uses the LLVM memory barrier intrinsic, closes #21 .
author | lindquist |
---|---|
date | Tue, 13 May 2008 17:58:11 +0200 |
parents | 3a784f7790d6 |
children | d9d5d59873d8 |
line wrap: on
line source
module vararg1; import std.c.stdarg; extern(C) int add(int n, ...) { va_list ap=void; va_start(ap, n); int r; for (int i=0; i<n; i++) r += va_arg!(int)(ap); va_end(ap); return r; } void main() { int i = add(4,1,2,3,4); assert(i == 10); }