blob: 90591a45b33557bbefeb0c2bc0f30bc30fec4afb [file] [log] [blame] [edit]
/*
* Copyright 2017, NICTA
*
* This software may be distributed and modified according to the terms of
* the GNU General Public License version 2. Note that NO WARRANTY is provided.
* See "LICENSE_GPLv2.txt" for details.
*
* @TAG(NICTA_GPL)
*/
$esc:(#include <stdio.h>)
$esc:(#include <stdlib.h>)
$esc:(#include <string.h>)
#include "mapper.c"
#include <wordarray.ac>
int main(void){
$ty:(WordArray U32) arr = malloc (sizeof ($ty:(WordArray U32)));
u32 arr_values[10];
int i;
for (i = 0; i < 10; i++) {
arr_values[i] = i;
}
arr->values = arr_values;
arr->len = 15;
arr = map (arr);
for (i = 0; i < 10; i++) {
printf ("arr[%d] = %d\n", i, arr->values[i]);
}
return 0;
}