File: abi.c

package info (click to toggle)
orc 1%3A0.4.6-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,856 kB
  • ctags: 2,889
  • sloc: ansic: 29,000; sh: 10,220; xml: 2,508; makefile: 196
file content (33 lines) | stat: -rw-r--r-- 551 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <orc/orc.h>

#include <stdio.h>


int main (int argc, char *argv[])
{
  long offset;
  int expected_offset;
  int error = 0;

  offset = ((long) ((unsigned char *) &((OrcProgram*) 0)->code_exec));

  if (sizeof(void *) == 4) {
    expected_offset = 8360;
  } else {
    expected_offset = 9688;
  }

  if (offset != expected_offset) {
    printf("ABI bug: OrcProgram->code_exec should be at offset %ld instead of %d\n",
        offset, expected_offset);
    error = 1;
  }

  return error;
}