mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-21 19:41:49 +01:00
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
This commit is contained in:
17
tests/mini/alloca1.d
Normal file
17
tests/mini/alloca1.d
Normal file
@@ -0,0 +1,17 @@
|
||||
module alloca1;
|
||||
|
||||
pragma(LLVM_internal, "alloca")
|
||||
void* alloca(uint);
|
||||
|
||||
extern(C) int printf(char*, ...);
|
||||
|
||||
void main()
|
||||
{
|
||||
int n = 16;
|
||||
int* p = cast(int*)alloca(n*int.sizeof);
|
||||
int[] a = p[0..n];
|
||||
a[] = 0;
|
||||
foreach(i,v; a) {
|
||||
printf("a[%2d] = %d\n", i, v);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user