diff options
author | alon@honor <none@none> | 2010-09-08 20:49:49 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-09-08 20:49:49 -0700 |
commit | 1e33f5826a47665a065af6a9c663976b824ff2a9 (patch) | |
tree | 8a307f0ac06c4cf58f6ae1faef3014d4262ad6bb /tests | |
parent | 6ec6e12212805c7e416f56a1d636d16f59174ea6 (diff) |
support for in-function statics
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 7bbfa80f..4d2c51c3 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -642,6 +642,27 @@ class T(unittest.TestCase): ''' self.do_test(src, '*cleaned*') + def test_statics(self): + src = ''' + #include <stdio.h> + #include <string.h> + + #define CONSTRLEN 32 + + void conoutfv(const char *fmt) + { + static char buf[CONSTRLEN]; + strcpy(buf, fmt); + puts(buf); + } + + int main() { + conoutfv("*staticccz*"); + return 0; + } + ''' + self.do_test(src, '*staticccz*') + def test_fannkuch(self): results = [ (1,0), (2,1), (3,2), (4,4), (5,7), (6,10), (7, 16), (8,22) ] for i, j in results: |