diff options
author | Matthew Sotoudeh <matthew@masot.net> | 2023-07-30 14:38:43 -0700 |
---|---|---|
committer | Matthew Sotoudeh <matthew@masot.net> | 2023-07-30 14:38:43 -0700 |
commit | 4de60a709d3af497781b7467f2c6fe7e09b39595 (patch) | |
tree | a9c4b70c6e87f37f9b69d77153c7cda10a60e043 /c/examples/zero_init/test.c | |
parent | 678b0d4a2ec15db0735d08ebafec55605ce0a688 (diff) |
basic libdietc for writing passes in C
Diffstat (limited to 'c/examples/zero_init/test.c')
-rw-r--r-- | c/examples/zero_init/test.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/c/examples/zero_init/test.c b/c/examples/zero_init/test.c new file mode 100644 index 0000000..5db109a --- /dev/null +++ b/c/examples/zero_init/test.c @@ -0,0 +1,20 @@ +#include <stdio.h> + +int set_xyz() { + int xyz = 1; + return xyz; +} + +int foo() { + int xyz; + return xyz; +} + +int main() { + printf("Foo return value: %d\n", foo()); + set_xyz(); + printf("Foo return value: %d\n", foo()); + set_xyz(); + printf("Foo return value: %d\n", foo()); + return 0; +} |