From 3a00cee584580529c43b8c17376cc7aaacc81e4c Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Sun, 29 Dec 2013 00:52:28 +0100 Subject: New optimization : some variables are put into registers. --- tests/exec/args2.cpp | 15 +++++++++++++++ tests/exec/args2.out | 2 ++ 2 files changed, 17 insertions(+) create mode 100644 tests/exec/args2.cpp create mode 100644 tests/exec/args2.out (limited to 'tests') 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 + +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 -- cgit v1.2.3