diff options
-rw-r--r-- | tests/cases/trunc.ll | 2 | ||||
-rw-r--r-- | tests/runner.py | 27 |
2 files changed, 28 insertions, 1 deletions
diff --git a/tests/cases/trunc.ll b/tests/cases/trunc.ll index 6af3656c..b46436ff 100644 --- a/tests/cases/trunc.ll +++ b/tests/cases/trunc.ll @@ -5,7 +5,7 @@ target triple = "i386-pc-linux-gnu" @.str = private constant [8 x i8] c"*%d,%d*\0A\00", align 1 ; [#uses=1] ; [#uses=1] -declare i32 @printf(i8*) +declare i32 @printf(i8* noalias, ...) ; [#uses=0] define i32 @main() { diff --git a/tests/runner.py b/tests/runner.py index 8e946fef..e8cfba42 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -387,6 +387,7 @@ if 'benchmark' not in sys.argv: self.do_test(src, output, force_c=True) def test_bigint(self): + if USE_TYPED_ARRAYS != 0: return self.skip() # Typed arrays truncate i64. src = ''' #include <stdio.h> int main() @@ -2239,10 +2240,36 @@ if 'benchmark' not in sys.argv: self.do_test(src, re.sub(r'\n\s+', '\n', expected)) def test_printf(self): + if USE_TYPED_ARRAYS != 0: return self.skip() # Typed arrays truncate i64. src = open(path_from_root('tests', 'printf', 'test.c'), 'r').read() expected = open(path_from_root('tests', 'printf', 'output.txt'), 'r').read() self.do_test(src, expected) + def test_vprintf(self): + src = r''' + #include <stdio.h> + #include <stdarg.h> + + void print(char* format, ...) { + va_list args; + va_start (args, format); + vprintf (format, args); + va_end (args); + } + + int main () { + print("Call with %d variable argument.\n", 1); + print("Call with %d variable %s.\n", 2, "arguments"); + + return 0; + } + ''' + expected = ''' + Call with 1 variable argument. + Call with 2 variable arguments. + ''' + self.do_test(src, re.sub('(^|\n)\s+', '\\1', expected)) + def test_langinfo(self): src = open(path_from_root('tests', 'langinfo', 'test.c'), 'r').read() expected = open(path_from_root('tests', 'langinfo', 'output.txt'), 'r').read() |