Issue homework 2: irgen

This commit is contained in:
Jeehoon Kang
2020-04-01 10:54:46 +09:00
parent 2a5a5e71ed
commit 93a1d767a5
18 changed files with 1009 additions and 588 deletions

9
examples/array.c Normal file
View File

@@ -0,0 +1,9 @@
int sum(int len, int p[2][3]) {
return 0;
}
int main() {
int a[2][3];
return 0;
}

View File

@@ -1,4 +1,4 @@
int f(int i, int const a[const i]) {
int f(int i, int const a[i]) {
int temp = 0;
const float temp2 = 0.f, temp3 = 0.f;
temp = sizeof(unsigned char);

10
examples/test.c Normal file
View File

@@ -0,0 +1,10 @@
int main() {
long int l = 1;
long l2 = 2;
short int s = 3;
short s2 = 4;
int i = 5;
char c = 6;
return l + l2 + s + s2 + i + c;
}

10
examples/typedef.c Normal file
View File

@@ -0,0 +1,10 @@
typedef int i32_t;
typedef i32_t* p_i32_t;
int main() {
i32_t a = 0;
p_i32_t const b = &a;
*b = 1;
return *b;
}