File: issue40.c

package info (click to toggle)
chibicc 1.0.23.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,832 kB
  • sloc: ansic: 62,911; sh: 275; makefile: 92
file content (17 lines) | stat: -rwxr-xr-x 270 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

#include "test.h"
int fun(int n, int a[n]) {
    int res = 0;
    for (int i = 0; i < n; i++)
        res = res + a[i];
    return res;
};

int main(void)
{
    int a[3] = {1, 2, 3};
    int b = fun(3, a);
    printf("%d %p \n", b, a);
    ASSERT(6, b);
    return 0;
}