diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-11-25 10:11:20 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-11-25 10:11:20 -0800 |
commit | 1edc791be84e53fb46b57770c67c6c7b54d2d58a (patch) | |
tree | 3603b545eda0d7c71187965c7063452b1ea9c084 /tests | |
parent | 23e1ca79b8e5358398dd997f8d55e383b78e02af (diff) |
strengthen (failing) mix_c_cpp test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/runner.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py index 4a84daec..52d1d0b0 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -1787,6 +1787,8 @@ if 'benchmark' not in str(sys.argv): #include "header.h" void dump(struct point p) { + p.x++; // should not modify + p.y++; // anything in the caller! printf("dump: %d,%d\n", p.x, p.y); } ''' @@ -1805,6 +1807,9 @@ if 'benchmark' not in str(sys.argv): point p = { 54, 2 }; printf("pre: %d,%d\n", p.x, p.y); dump(p); + void (*dp)(point p) = dump; // And, as a function pointer + dp(p); + printf("post: %d,%d\n", p.x, p.y); return 0; } ''' @@ -1816,7 +1821,7 @@ if 'benchmark' not in str(sys.argv): all_name = os.path.join(self.get_dir(), 'all.bc') Building.link([supp_name + '.o', main_name + '.o'], all_name) - self.do_ll_run(all_name, 'pre: 54,2\ndump: 54,2\n') + self.do_ll_run(all_name, 'pre: 54,2\ndump: 55,3\ndump: 55,3\npost: 54,2') def test_stdlibs(self): if Settings.USE_TYPED_ARRAYS == 2: |