mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-14 22:38:46 +00:00
Issue homework 2: irgen
This commit is contained in:
9
examples/array.c
Normal file
9
examples/array.c
Normal file
@@ -0,0 +1,9 @@
|
||||
int sum(int len, int p[2][3]) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int a[2][3];
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -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
10
examples/test.c
Normal 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
10
examples/typedef.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user