diff options
author | Teddy <[email protected]> | 2014-05-04 22:24:42 +0800 |
---|---|---|
committer | Teddy <[email protected]> | 2014-05-04 22:24:42 +0800 |
commit | 679c091bf746798e7272ac0842cf3d8dd9dd6251 (patch) | |
tree | 9e1063a686c1536ceb12d4082d15b936ae9568a5 /testbed/custom_struct4.c | |
parent | d44c79c26afd6945d912a4a3423038a5a4594138 (diff) |
add some custom testcases
Diffstat (limited to 'testbed/custom_struct4.c')
-rw-r--r-- | testbed/custom_struct4.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/testbed/custom_struct4.c b/testbed/custom_struct4.c new file mode 100644 index 0000000..75f50ea --- /dev/null +++ b/testbed/custom_struct4.c @@ -0,0 +1,28 @@ +struct A {
+ struct B {
+ int x, y;
+ struct C {
+ int w;
+ } c;
+ } b;
+ int z;
+};
+
+struct B f(struct A a) {
+ printf("z: %d\n", a.z);
+ return a.b;
+}
+
+struct C g(struct B b) {
+ printf("x: %d\ny: %d\n", b.x, b.y);
+ return b.c;
+}
+
+int main() {
+ struct A a;
+ a.z = 1;
+ a.b.x = 2;
+ a.b.y = 3;
+ a.b.c.w = 4;
+ printf("w: %d\n", g(f(a)).w);
+}
|