2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / consistency.vlad / layout / class-long-and-virtual.cpp
blobde5c77c51548431aebbc17d86267a3c83c96e398
1 #include <stdio.h>
3 static class sss {
4 public:
5 long m;
6 virtual int f (int i) {return i;}
7 } sss;
9 #define _offsetof(st,f) ((char *)&((st *) 16)->f - (char *) 16)
11 int main (void) {
12 printf ("+++Class starting with long and containing virtual function:\n");
13 printf ("size=%d,align=%d\n", sizeof (sss), __alignof__ (sss));
14 printf ("offset-m=%d,align-m=%d\n",
15 _offsetof (class sss, m), __alignof__ (sss.m));