view test/macro.c @ 236:7353a818858c

ia32 code creg fix done
author kono
date Thu, 29 Apr 2004 23:53:31 +0900
parents 1d80ad165831
children 9df8aa0497ea
line wrap: on
line source


int heap[100];

#define car(e) (heap[(int)(e)])
#define cadr(e) (heap[((int)(e))+1])

#define TEST
int i;
TEST

#define TEST0 33
#define TEST111 TEST0

#define c(a,b)  g(a+1,b+1)
#define g(a,b)  printf("%d %d\n",a+1,b+1);
#define d(a,b)  cadr(b)+3
/*

    #define stdio stdio
    #define f(a,b) aho+a+b
    f (a,b)
*/

main() {
   int a,b,e;

   b = heap[TEST111];
   d(a,b);
   a =1; b = 3;
#ifndef a
   c(a,
      b);
   /* 3,5 expected */
#endif
   e=50; heap[51]=3; heap[3]=4;
   /* 5,4 expected */
#if 0
   g(car(cadr(e)),cadr(e));
#endif
#if 0
   printf("1\n");
#elif (1)
   printf("2\n");
#elif (2)
   printf("3\n");
#else
   printf("4\n");
#endif
#if 0
   printf("1\n");
#elif (0)
   printf("2\n");
#elif (0)
   printf("3\n");
#else
   printf("4\n");
#endif
    return 0;
}