From be8b04496302184c6e8f04d6179f9c3afc50aeb6 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Wed, 6 Jan 2016 01:47:28 -0800 Subject: initial commit --- .../layout/c-pointer-1-c-float.cpp | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 gcc/testsuite/consistency.vlad/layout/c-pointer-1-c-float.cpp (limited to 'gcc/testsuite/consistency.vlad/layout/c-pointer-1-c-float.cpp') diff --git a/gcc/testsuite/consistency.vlad/layout/c-pointer-1-c-float.cpp b/gcc/testsuite/consistency.vlad/layout/c-pointer-1-c-float.cpp new file mode 100755 index 0000000..c916414 --- /dev/null +++ b/gcc/testsuite/consistency.vlad/layout/c-pointer-1-c-float.cpp @@ -0,0 +1,23 @@ +#include + +class c{ +public: + char * f; +}; + + +static class sss: public c{ +public: + float m; +} sss; + +#define _offsetof(st,f) ((char *)&((st *) 16)->f - (char *) 16) + +int main (void) { + printf ("++Class with float inhereting class with pointer:\n"); + printf ("size=%d,align=%d\n", sizeof (sss), __alignof__ (sss)); + printf ("offset-pointer=%d,offset-float=%d,\nalign-pointer=%d,align-float=%d\n", + _offsetof (class sss, f), _offsetof (class sss, m), + __alignof__ (sss.f), __alignof__ (sss.m)); + return 0; +} -- cgit v1.2.3