mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-29 10:32:47 +00:00
*** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3447 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4afd6c37c7
commit
397f58bb0b
26
test/LLC/badidx.c
Normal file
26
test/LLC/badidx.c
Normal file
@ -0,0 +1,26 @@
|
||||
/* -*- mode: c -*-
|
||||
* $Id$
|
||||
* http://www.bagley.org/~doug/shootout/
|
||||
*
|
||||
* this program is modified from:
|
||||
* http://cm.bell-labs.com/cm/cs/who/bwk/interps/pap.html
|
||||
* Timing Trials, or, the Trials of Timing: Experiments with Scripting
|
||||
* and User-Interface Languages</a> by Brian W. Kernighan and
|
||||
* Christopher J. Van Wyk.
|
||||
*
|
||||
* I added free() to deallocate memory.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
main(int argc, char *argv[]) {
|
||||
int i, n = ((argc == 2) ? atoi(argv[1]) : 1);
|
||||
int *y = (int *) calloc(n, sizeof(int));
|
||||
for (i=0; i < n; i++)
|
||||
y[i] = i*i;
|
||||
printf("%d\n", y[n-1]);
|
||||
return(0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user