diff options
author | Alex AUVOLAT <alex.auvolat@ens.fr> | 2013-12-29 00:52:28 +0100 |
---|---|---|
committer | Alex AUVOLAT <alex.auvolat@ens.fr> | 2013-12-29 00:52:28 +0100 |
commit | 3a00cee584580529c43b8c17376cc7aaacc81e4c (patch) | |
tree | ee6667e9e8422e29f993ffb5344faeeaf588a26d /tests | |
parent | 33d5003ca9a99d4e933cf427fa1249ed1a843dba (diff) | |
download | LPC-Projet-3a00cee584580529c43b8c17376cc7aaacc81e4c.tar.gz LPC-Projet-3a00cee584580529c43b8c17376cc7aaacc81e4c.zip |
New optimization : some variables are put into registers.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/exec/args2.cpp | 15 | ||||
-rw-r--r-- | tests/exec/args2.out | 2 |
2 files changed, 17 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"; +} + diff --git a/tests/exec/args2.out b/tests/exec/args2.out new file mode 100644 index 0000000..7921196 --- /dev/null +++ b/tests/exec/args2.out @@ -0,0 +1,2 @@ +x = 0 +y = 42 |