From bb9bc99245b79e51df2ebc3688593a5420246ff0 Mon Sep 17 00:00:00 2001 From: Ilya Shchepetkov Date: Mon, 3 Sep 2018 13:27:10 +0300 Subject: [PATCH] Update Aspectator and add one more test case --- aspectator | 2 +- tests/input/complex.c | 3 +++ tests/test_complex.py | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tests/input/complex.c create mode 100644 tests/test_complex.py diff --git a/aspectator b/aspectator index 8586357..a426e15 160000 --- a/aspectator +++ b/aspectator @@ -1 +1 @@ -Subproject commit 8586357d59dcd63e95187412426331782b35b821 +Subproject commit a426e15156729ff79b161de16d83495fd3c81793 diff --git a/tests/input/complex.c b/tests/input/complex.c new file mode 100644 index 0000000..71de3e5 --- /dev/null +++ b/tests/input/complex.c @@ -0,0 +1,3 @@ +void test(int a, int b, int c) { + int x = __builtin_mul_overflow (a, b, &c); +} diff --git a/tests/test_complex.py b/tests/test_complex.py new file mode 100644 index 0000000..7abf3b7 --- /dev/null +++ b/tests/test_complex.py @@ -0,0 +1,15 @@ +import unittest +import utils + + +class TestComplex(utils.CIFTestCase): + # Test for REALPART_EXPR and IMAGPART_EXPR - only up to instrumentation stage. + # These nodes represent respectively the real and the imaginary parts of complex numbers (their sole argument). + # Compilation stage with "src" back-end require support for these expressions in c-backend. + def test_realpart_expr(self): + self.cif.run(cif_input='input/complex.c', aspect='aspect/empty.aspect', stage='instrumentation') + self.check_cif_status() + + +if __name__ == '__main__': + unittest.main()