aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-06-14 14:14:08 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-06-14 14:14:08 -0700
commit1bdb3a5e9f3521dfd856a3a4363557eab4968bd8 (patch)
treef3d26e344da14974a0b98f1c01f450fbcf8ac474 /tests/runner.py
parent031f922df9e336a700de8de2294a60a66a8daf1f (diff)
ignore phi assigns of undef
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 58bc3bef..d0360e00 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -4782,6 +4782,43 @@ def process(filename):
self.do_run(src, '*15,15*\n*15,10*\n*6,10*\n*10,0*\n*7,1*')
+ def test_phiundef(self):
+ src = r'''
+#include <stdlib.h>
+#include <stdio.h>
+
+static int state;
+
+struct my_struct {
+ union {
+ struct {
+ unsigned char a;
+ unsigned char b;
+ } c;
+ unsigned int d;
+ } e;
+ unsigned int f;
+};
+
+int main(int argc, char **argv) {
+ struct my_struct r;
+
+ state = 0;
+
+ for (int i=0;i<argc+10;i++)
+ {
+ if (state % 2 == 0)
+ r.e.c.a = 3;
+ else
+ printf("%d\n", r.e.c.a);
+ state++;
+ }
+ return 0;
+}
+ '''
+
+ self.do_run(src, '3\n3\n3\n3\n3\n')
+
# libc++ tests
def test_iostream(self):