def test_unaligned(self):
    self.skipTest('LLVM marks the reads of s as fully aligned, making this test invalid')
    src = '\n      #include <stdio.h>\n\n      struct S {\n        double x;\n        int y;\n      };\n\n      int main() {\n        // the 64-bit value here will not be 8-byte aligned\n        S s0[3] = { {0x12a751f430142, 22}, {0x17a5c85bad144, 98}, {1, 1}};\n        char buffer[10*sizeof(S)];\n        int b = int(buffer);\n        S *s = (S*)(b + 4-b%8);\n        s[0] = s0[0];\n        s[1] = s0[1];\n        s[2] = s0[2];\n\n        printf("*%d : %d : %d\\n", sizeof(S), ((unsigned int)&s[0]) % 8 != ((unsigned int)&s[1]) % 8,\n                                             ((unsigned int)&s[1]) - ((unsigned int)&s[0]));\n        s[0].x++;\n        s[0].y++;\n        s[1].x++;\n        s[1].y++;\n        printf("%.1f,%d,%.1f,%d\\n", s[0].x, s[0].y, s[1].x, s[1].y);\n        return 0;\n      }\n      '
    self.do_run(src, '*12 : 1 : 12\n328157500735811.0,23,416012775903557.0,99\n')
    return
    src = '\n      #include <stdio.h>\n\n      int main()\n      {\n        int x[10];\n        char *p = (char*)&x[0];\n        p++;\n        short *q = (short*)p;\n        *q = 300;\n        printf("*%d:%d*\\n", *q, ((int)q)%2);\n        int *r = (int*)p;\n        *r = 515559;\n        printf("*%d*\\n", *r);\n        long long *t = (long long*)p;\n        *t = 42949672960;\n        printf("*%lld*\\n", *t);\n        return 0;\n      }\n    '
    try:
        self.do_run(src, '*300:1*\n*515559*\n*42949672960*\n')
    except Exception as e:
        assert ('must be aligned' in str(e)), e
def test_unaligned(self):
    self.skipTest('LLVM marks the reads of s as fully aligned, making this test invalid')
    src = '\n      #include <stdio.h>\n\n      struct S {\n        double x;\n        int y;\n      };\n\n      int main() {\n        // the 64-bit value here will not be 8-byte aligned\n        S s0[3] = { {0x12a751f430142, 22}, {0x17a5c85bad144, 98}, {1, 1}};\n        char buffer[10*sizeof(S)];\n        int b = int(buffer);\n        S *s = (S*)(b + 4-b%8);\n        s[0] = s0[0];\n        s[1] = s0[1];\n        s[2] = s0[2];\n\n        printf("*%d : %d : %d\\n", sizeof(S), ((unsigned int)&s[0]) % 8 != ((unsigned int)&s[1]) % 8,\n                                             ((unsigned int)&s[1]) - ((unsigned int)&s[0]));\n        s[0].x++;\n        s[0].y++;\n        s[1].x++;\n        s[1].y++;\n        printf("%.1f,%d,%.1f,%d\\n", s[0].x, s[0].y, s[1].x, s[1].y);\n        return 0;\n      }\n      '
    self.do_run(src, '*12 : 1 : 12\n328157500735811.0,23,416012775903557.0,99\n')
    return
    src = '\n      #include <stdio.h>\n\n      int main()\n      {\n        int x[10];\n        char *p = (char*)&x[0];\n        p++;\n        short *q = (short*)p;\n        *q = 300;\n        printf("*%d:%d*\\n", *q, ((int)q)%2);\n        int *r = (int*)p;\n        *r = 515559;\n        printf("*%d*\\n", *r);\n        long long *t = (long long*)p;\n        *t = 42949672960;\n        printf("*%lld*\\n", *t);\n        return 0;\n      }\n    '
    try:
        self.do_run(src, '*300:1*\n*515559*\n*42949672960*\n')
    except Exception as e:
        assert ('must be aligned' in str(e)), e