aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-12-06 15:16:09 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-12-06 15:16:09 -0800
commitbe5dcf031832f1d5e3cb687f067097fc9eaa33b3 (patch)
tree45d611529c2e3b8adad17d1bc010f136fd893dcd /tests/runner.py
parent714db718cb77881fe6e9b135df668698074652ae (diff)
add failing double alignment test
Diffstat (limited to 'tests/runner.py')
-rw-r--r--tests/runner.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index fc2fdd4b..bd4e3156 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -510,6 +510,36 @@ if 'benchmark' not in str(sys.argv):
def test_unaligned(self):
if Settings.QUANTUM_SIZE == 1: return self.skip('No meaning to unaligned addresses in q1')
+
+ src = r'''
+ #include<stdio.h>
+
+ struct S {
+ double x;
+ int y;
+ };
+
+ int main() {
+ // the 64-bit value here will not always be 8-byte aligned
+ S s[3] = { {0x12a751f430142, 22}, {0x17a5c85bad144, 98}, {1, 1}};
+ printf("*%d : %d : %d\n", sizeof(S), ((unsigned int)&s[0]) % 8 != ((unsigned int)&s[1]) % 8,
+ ((unsigned int)&s[1]) - ((unsigned int)&s[0]));
+ s[0].x++;
+ s[0].y++;
+ s[1].x++;
+ s[1].y++;
+ printf("%.1f,%d,%.1f,%d\n", s[0].x, s[0].y, s[1].x, s[1].y);
+ return 0;
+ }
+ '''
+
+ # TODO: A version of this with int64s as well
+ self.do_run(src, '*12 : 1 : 12\n328157500735811.0,23,416012775903557.0,99\n')
+
+ return # TODO: continue to the next part here
+
+ # Test for undefined behavior in C. This is not legitimate code, but does exist
+
if Settings.USE_TYPED_ARRAYS != 2: return self.skip('No meaning to unaligned addresses without t2')
src = r'''