summaryrefslogtreecommitdiff
path: root/tests/exec/args2.cpp
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2014-01-08 22:54:39 +0100
committerAlex AUVOLAT <alex.auvolat@ens.fr>2014-01-08 22:54:39 +0100
commit56fdab2ff0caaaa88a152ef06aef821f432fe488 (patch)
tree0ff29c512656af42359b8298d9c990c6cb9a5ad7 /tests/exec/args2.cpp
parent622f76becf4b8cbf4a56daa913070487481b87cf (diff)
downloadLPC-Projet-56fdab2ff0caaaa88a152ef06aef821f432fe488.tar.gz
LPC-Projet-56fdab2ff0caaaa88a152ef06aef821f432fe488.zip
Added args1 and args2 test.
Diffstat (limited to 'tests/exec/args2.cpp')
-rw-r--r--tests/exec/args2.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/exec/args2.cpp b/tests/exec/args2.cpp
new file mode 100644
index 0000000..1d2efee
--- /dev/null
+++ b/tests/exec/args2.cpp
@@ -0,0 +1,15 @@
+#include <iostream>
+
+int test(int a) {
+ int *b = &a;
+ *b = *b + 42;
+ return a;
+}
+
+int main() {
+ int x = 0;
+ int y = test(x);
+ std::cout << "x = " << x << "\n";
+ std::cout << "y = " << y << "\n";
+}
+