diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-04-17 18:39:00 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-04-17 18:39:00 -0700 |
commit | f72cf763607f2d69044493e9d1c3a818248ea929 (patch) | |
tree | f46bde8fd00104e5074c3d99ee848813e49685ff /tests | |
parent | b48fb4d83121ee776cce12a7be43afed7332bd7d (diff) |
finalize parameters in getGetElementPtrIndexes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/runner.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index 635a4d0f..6e061cd1 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -463,6 +463,27 @@ if 'benchmark' not in sys.argv: ''' self.do_test(src, '*3.14,-3.14,Infinity*') + def test_getgep(self): + # Generated code includes getelementptr (getelementptr, 0, 1), i.e., GEP as the first param to GEP + src = ''' + #include <stdio.h> + struct { + int y[10]; + int z[10]; + } commonblock; + + int main() + { + for (int i = 0; i < 10; ++i) { + commonblock.y[i] = 1; + commonblock.z[i] = 2; + } + printf("*%d %d*\\n", commonblock.y[0], commonblock.z[0]); + return 0; + } + ''' + self.do_test(src, '*1 2*') + def test_if(self): src = ''' #include <stdio.h> |