This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[named-addr-spaces-branch] [PATCH,committed] Rework grokdeclarator for named addresses


This patch reworks how grokdeclarator builds the symbol tree, to allow for
things like:

       __ea char * __ea * * foo;

This isn't the final patch for named addresses, as there is code gen bug I need
to track down, and I need to investigate the comments about c-typechk.c.

[gcc]
2008-11-20  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* tree.h (CLEAR_QUAL_ADDR_SPACE): New macro to clear out the
	address space portion of the qualifier encoding.

	* c-decl.c (grokdeclarator): Rewrite code dealing with named
	address spaces so that the correct named address is picked up for
	multiple pointer levels, like char *__ea *__ea foo.

	* config/spu/spu.c (expand_ea_mem): Add comment for having back to
	back set_mem_alias calls.  Explicitly clear the named address for
	the cached pointer.

[gcc/testsuite]
2008-11-20  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* gcc.target/spu/ea/test-sizes.c: New test to test the size of
	host and __ea pointers.

Index: gcc/tree.h
===================================================================
--- gcc/tree.h	(revision 142041)
+++ gcc/tree.h	(working copy)
@@ -2201,6 +2201,7 @@ struct tree_block GTY(())
    than 8 qualifiers are added, these macros need to be adjusted.  */
 #define ENCODE_QUAL_ADDR_SPACE(NUM) ((NUM & 0xFF) << 8)
 #define DECODE_QUAL_ADDR_SPACE(X) (((X) >> 8) & 0xFF)
+#define CLEAR_QUAL_ADDR_SPACE(X) ((X) & ~0xFF00)
 
 /* The set of type qualifiers for this type.  */
 #define TYPE_QUALS(NODE)					\
Index: gcc/c-decl.c
===================================================================
--- gcc/c-decl.c	(revision 142041)
+++ gcc/c-decl.c	(working copy)
@@ -3996,7 +3996,6 @@ grokdeclarator (const struct c_declarato
   int constp;
   int restrictp;
   int volatilep;
-  int addr_space_p;
   int type_quals = TYPE_UNQUALIFIED;
   const char *name, *orig_name;
   bool funcdef_flag = false;
@@ -4011,7 +4010,7 @@ grokdeclarator (const struct c_declarato
   bool bitfield = width != NULL;
   tree element_type;
   struct c_arg_info *arg_info = 0;
-  addr_space_t as1, as2;
+  addr_space_t as1, as2, address_space;
 
   if (decl_context == FUNCDEF)
     funcdef_flag = true, decl_context = NORMAL;
@@ -4112,7 +4111,10 @@ grokdeclarator (const struct c_declarato
   constp = declspecs->const_p + TYPE_READONLY (element_type);
   restrictp = declspecs->restrict_p + TYPE_RESTRICT (element_type);
   volatilep = declspecs->volatile_p + TYPE_VOLATILE (element_type);
-  addr_space_p = (declspecs->address_space != 0) + (TYPE_ADDR_SPACE (element_type) != 0);
+  as1 = declspecs->address_space;
+  as2 = TYPE_ADDR_SPACE (element_type);
+  address_space = (as1 ? as1 : as2);
+
   if (pedantic && !flag_isoc99)
     {
       if (constp > 1)
@@ -4123,9 +4125,6 @@ grokdeclarator (const struct c_declarato
 	pedwarn (input_location, OPT_pedantic, "duplicate %<volatile%>");
     }
 
-  as1 = declspecs->address_space;
-  as2 = TYPE_ADDR_SPACE (element_type);
-  
   if (as1 > 0 && as2 > 0 && as1 != as2)
     error ("incompatible address space qualifiers %qs and %qs",
 	   targetm.addr_space.name (as1),
@@ -4136,71 +4135,11 @@ grokdeclarator (const struct c_declarato
   type_quals = ((constp ? TYPE_QUAL_CONST : 0)
 		| (restrictp ? TYPE_QUAL_RESTRICT : 0)
 		| (volatilep ? TYPE_QUAL_VOLATILE : 0)
-		| (addr_space_p ? ENCODE_QUAL_ADDR_SPACE (declspecs->address_space) : 0));
+		| ENCODE_QUAL_ADDR_SPACE (address_space));
 
   /* Warn about storage classes that are invalid for certain
      kinds of declarations (parameters, typenames, etc.).  */
 
-  if (((declarator->kind == cdk_pointer
- 	&& (DECODE_QUAL_ADDR_SPACE (declarator->u.pointer_quals)) != 0)
-       || addr_space_p)
-      && targetm.addr_space.name == default_addr_space_name)
-     {
-       /* A mere warning is sure to result in improper semantics
-	  at runtime.  Don't bother to allow this to compile.  */
-       error ("extended address space not supported for this target");
-       return 0;
-     }
-
-  if (declarator->kind == cdk_pointer
-      ? (DECODE_QUAL_ADDR_SPACE (declarator->u.pointer_quals)) != 0
-      : addr_space_p)
-    {
-      const char *addrspace_name;
-
-      /* Either declspecs or the declarator identifies the address space.  */
-      if (declspecs->address_space)
-	addrspace_name = targetm.addr_space.name (declspecs->address_space);
-      else
-	addrspace_name = targetm.addr_space.name (DECODE_QUAL_ADDR_SPACE (declarator->u.pointer_quals));
-
-      if (decl_context == NORMAL)
-	{
-	  if (declarator->kind == cdk_function)
-	    error ("%qs specified for function %qs", addrspace_name, name);
-	  else
-	    {
-	      switch (storage_class)
-		{
-		case csc_auto:
-		  error ("%qs combined with %<auto%> qualifier for %qs", addrspace_name, name);
-		  break;
-		case csc_register:
-		  error ("%qs combined with %<register%> qualifier for %qs", addrspace_name, name);
-		  break;
-		case csc_none:
-		  if (current_function_scope)
- 		    {
- 		      error ("%<__ea%> specified for auto variable %qs", name);
- 		      break;
- 		    }
-		  break;
-		case csc_static:
-		  break;
-		case csc_extern:
-		  break;
-		case csc_typedef:
-		  break;
-		}
-	    }
-	}
-      else if (decl_context == PARM
-	       && declarator->kind != cdk_array)
-	error ("%qs specified for parameter %qs", addrspace_name, name);
-      else if (decl_context == FIELD)
-	error ("%qs specified for structure field %qs", addrspace_name, name);
-    }
-
   if (funcdef_flag
       && (threadp
 	  || storage_class == csc_auto
@@ -4614,6 +4553,15 @@ grokdeclarator (const struct c_declarato
 	    if (really_funcdef)
 	      put_pending_sizes (arg_info->pending_sizes);
 
+	    /* Warn about functions declared in another address space.  */
+	    address_space = DECODE_QUAL_ADDR_SPACE (type_quals);
+	    if (address_space)
+	      {
+		type_quals = CLEAR_QUAL_ADDR_SPACE (type_quals);
+		error ("%qs specified for function %qs",
+		       targetm.addr_space.name (address_space), name);
+	      }
+
 	    /* Type qualifiers before the return type of the function
 	       qualify the return type, not the function type.  */
 	    if (type_quals)
@@ -4716,6 +4664,47 @@ grokdeclarator (const struct c_declarato
   /* Now TYPE has the actual type, apart from any qualifiers in
      TYPE_QUALS.  */
 
+  /* Warn about address space used for things other that static memory or
+     pointers.  */
+  address_space = DECODE_QUAL_ADDR_SPACE (type_quals);
+  if (address_space)
+    {
+      if (decl_context == NORMAL)
+	{
+	  switch (storage_class)
+	    {
+	    case csc_auto:
+	      error ("%qs combined with %<auto%> qualifier for %qs",
+		     targetm.addr_space.name (address_space), name);
+	      break;
+	    case csc_register:
+	      error ("%qs combined with %<register%> qualifier for %qs",
+		     targetm.addr_space.name (address_space), name);
+	      break;
+	    case csc_none:
+	      if (current_function_scope)
+		{
+		  error ("%qs specified for auto variable %qs",
+			 targetm.addr_space.name (address_space), name);
+		  break;
+		}
+	      break;
+	    case csc_static:
+	    case csc_extern:
+	    case csc_typedef:
+	      break;
+	    default:
+	      gcc_unreachable ();
+	    }
+	}
+      else if (decl_context == PARM && TREE_CODE (type) != ARRAY_TYPE)
+	error ("%qs specified for parameter %qs",
+	       targetm.addr_space.name (address_space), name);
+      else if (decl_context == FIELD)
+	error ("%qs specified for structure field %qs",
+	       targetm.addr_space.name (address_space), name);
+    }
+
   /* Check the type and width of a bit-field.  */
   if (bitfield)
     check_bitfield_type_and_width (&type, width, orig_name);
@@ -4739,7 +4728,7 @@ grokdeclarator (const struct c_declarato
     {
       tree decl;
       if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
-	  && type_quals)
+	  && CLEAR_QUAL_ADDR_SPACE (type_quals))
 	pedwarn (input_location, OPT_pedantic,
 		 "ISO C forbids qualified function types");
       if (type_quals)
@@ -4763,7 +4752,7 @@ grokdeclarator (const struct c_declarato
       gcc_assert (storage_class == csc_none && !threadp
 		  && !declspecs->inline_p);
       if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
-	  && type_quals)
+	  && CLEAR_QUAL_ADDR_SPACE (type_quals))
 	pedwarn (input_location, OPT_pedantic,
 		 "ISO C forbids const or volatile function types");
       if (type_quals)
@@ -5065,8 +5054,8 @@ grokdeclarator (const struct c_declarato
 	C_DECL_REGISTER (decl) = was_reg;
       }
 
-  /* This is the earliest point at which we might know the assembler
-     name of a variable.  Thus, if it's known before this, die horribly.  */
+    /* This is the earliest point at which we might know the assembler name of
+       a variable.  Thus, if it's known before this, die horribly.  */
     gcc_assert (!DECL_ASSEMBLER_NAME_SET_P (decl));
 
     return decl;
Index: gcc/config/spu/spu.c
===================================================================
--- gcc/config/spu/spu.c	(revision 142041)
+++ gcc/config/spu/spu.c	(working copy)
@@ -4376,6 +4376,7 @@ expand_ea_mem (rtx mem, bool is_store)
 {
   rtx ea_addr;
   rtx data_addr = gen_reg_rtx (Pmode);
+  rtx new_mem;
 
   ea_addr = force_reg (EAmode, XEXP (mem, 0));
   if (optimize_size || optimize == 0)
@@ -4383,13 +4384,21 @@ expand_ea_mem (rtx mem, bool is_store)
   else
     ea_load_store_inline (mem, is_store, ea_addr, data_addr);
 
-  mem = change_address (mem, VOIDmode, data_addr);
-
   if (ea_alias_set == -1)
     ea_alias_set = new_alias_set ();
-  set_mem_alias_set (mem, 0);
-  set_mem_alias_set (mem, ea_alias_set);
-  return mem;
+
+  new_mem = change_address (mem, VOIDmode, data_addr);
+
+  /* We can't just change the alias set directly to ea_alias_set, because the
+     --enable-checking code may complain that the alias sets don't conflict */
+  set_mem_alias_set (new_mem, 0);
+  set_mem_alias_set (new_mem, ea_alias_set);
+
+  /* Manually reset the address space of the pointer back to the generic
+     address space.  */
+  set_mem_addr_space (new_mem, ADDR_SPACE_GENERIC);
+
+  return new_mem;
 }
 
 int
Index: gcc/testsuite/gcc.target/spu/ea/test-sizes.c
===================================================================
--- gcc/testsuite/gcc.target/spu/ea/test-sizes.c	(revision 0)
+++ gcc/testsuite/gcc.target/spu/ea/test-sizes.c	(revision 0)
@@ -0,0 +1,590 @@
+/* { dg-do run { target spu-*-* } } */
+/* { dg-options "-std=gnu99 -mea64" } */
+
+#ifndef __EA64__
+#error "-mea64 must be used"
+#endif
+
+#if !defined(LEVEL1) && !defined(LEVEL2) && !defined(LEVEL3)
+#define LEVEL1 1		/* single pointer indirection */
+#define LEVEL2 1		/* 2 levels of pointer indirection */
+#define LEVEL3 1		/* 3 levels of pointer indirection */
+
+#else
+#ifndef LEVEL1
+#define LEVEL1 0
+#endif
+
+#ifndef LEVEL2
+#define LEVEL2 0
+#endif
+
+#ifndef LEVEL3
+#define LEVEL3 0
+#endif
+#endif
+
+#if !defined(USE_SIMPLE) && !defined(USE_COMPLEX)
+#define USE_SIMPLE  1		/* build up pointers via multiple typedefs */
+#define USE_COMPLEX 1		/* single typedef for pointer indirections */
+
+#else
+#ifndef USE_SIMPLE
+#define USE_SIMPLE 0
+#endif
+
+#ifndef USE_COMPLEX
+#define USE_COMPLEX 0
+#endif
+#endif
+
+#if !defined(USE_LOCAL_VAR) && !defined(USE_EA_VAR)
+#define USE_LOCAL_VAR 1		/* use variables declared locally */
+#define USE_EA_VAR    1		/* use variables on the host */
+
+#else
+#ifndef USE_LOCAL_VAR
+#define USE_LOCAL_VAR 0
+#endif
+
+#ifndef USE_EA_VAR
+#define USE_EA_VAR    0
+#endif
+#endif
+
+static int errors;
+
+#ifdef USE_PRINTF		/* print results via printf */
+#include <stdio.h>
+#include <stdlib.h>
+
+static int num_tests;
+
+#define TEST_SIZE(EXPR, EXPECTED)					\
+do {									\
+  char *msg;								\
+									\
+  if (sizeof (EXPR) != EXPECTED)					\
+    {									\
+      msg = ", FAIL";							\
+      errors++;								\
+    }									\
+  else									\
+    msg = "";								\
+									\
+  num_tests++;								\
+  printf ("sizeof %-20s = %2u, expected = %2u%s\n",			\
+	  #EXPR,							\
+	  (unsigned) sizeof (EXPR),					\
+	  (unsigned) EXPECTED,						\
+	  msg);								\
+} while (0)
+
+#define PRINT1(FMT)	  printf (FMT)
+#define PRINT2(FMT,A1)	  printf (FMT,A1)
+#define PRINT3(FMT,A1,A2) printf (FMT,A1,A2)
+
+#else	/* standalone */
+extern void abort (void);
+
+#define TEST_SIZE(EXPR, EXPECTED)					\
+do {									\
+  if (sizeof (EXPR) != EXPECTED)					\
+    abort ();								\
+} while (0)
+
+#define PRINT1(FMT)
+#define PRINT2(FMT,ARG)
+#define PRINT3(FMT,A1,A2)
+#endif
+
+/* 'local memory' hack to keep the same spacing.  */
+#define __lm
+
+#if USE_SIMPLE
+#if (LEVEL1 || LEVEL2 || LEVEL3)
+typedef __lm char *lm_ptr_t;
+typedef __ea char *ea_ptr_t;
+#endif
+
+#if LEVEL1
+#if USE_LOCAL_VAR
+__lm lm_ptr_t lm_ptr;
+__lm ea_ptr_t ea_ptr;
+#endif
+
+#if USE_EA_VAR
+__ea lm_ptr_t lm_ptr_ea;
+__ea ea_ptr_t ea_ptr_ea;
+#endif
+#endif
+
+#if (LEVEL2 || LEVEL3)
+typedef __lm lm_ptr_t *lm_lm_ptr_t;
+typedef __ea lm_ptr_t *ea_lm_ptr_t;
+typedef __lm ea_ptr_t *lm_ea_ptr_t;
+typedef __ea ea_ptr_t *ea_ea_ptr_t;
+#endif
+
+#if LEVEL2
+#if USE_LOCAL_VAR
+__lm lm_lm_ptr_t lm_lm_ptr;
+__lm ea_lm_ptr_t ea_lm_ptr;
+__lm lm_ea_ptr_t lm_ea_ptr;
+__lm ea_ea_ptr_t ea_ea_ptr;
+#endif
+
+#if USE_EA_VAR
+__ea lm_lm_ptr_t lm_lm_ptr_ea;
+__ea ea_lm_ptr_t ea_lm_ptr_ea;
+__ea lm_ea_ptr_t lm_ea_ptr_ea;
+__ea ea_ea_ptr_t ea_ea_ptr_ea;
+#endif
+#endif
+
+#if LEVEL3
+typedef __lm lm_lm_ptr_t *lm_lm_lm_ptr_t;
+typedef __ea lm_lm_ptr_t *ea_lm_lm_ptr_t;
+typedef __lm ea_lm_ptr_t *lm_ea_lm_ptr_t;
+typedef __ea ea_lm_ptr_t *ea_ea_lm_ptr_t;
+typedef __lm lm_ea_ptr_t *lm_lm_ea_ptr_t;
+typedef __ea lm_ea_ptr_t *ea_lm_ea_ptr_t;
+typedef __lm ea_ea_ptr_t *lm_ea_ea_ptr_t;
+typedef __ea ea_ea_ptr_t *ea_ea_ea_ptr_t;
+
+#if USE_LOCAL_VAR
+__lm lm_lm_lm_ptr_t lm_lm_lm_ptr;
+__lm ea_lm_lm_ptr_t ea_lm_lm_ptr;
+__lm lm_ea_lm_ptr_t lm_ea_lm_ptr;
+__lm ea_ea_lm_ptr_t ea_ea_lm_ptr;
+__lm lm_lm_ea_ptr_t lm_lm_ea_ptr;
+__lm ea_lm_ea_ptr_t ea_lm_ea_ptr;
+__lm lm_ea_ea_ptr_t lm_ea_ea_ptr;
+__lm ea_ea_ea_ptr_t ea_ea_ea_ptr;
+#endif
+
+#if USE_EA_VAR
+__ea lm_lm_lm_ptr_t lm_lm_lm_ptr_ea;
+__ea ea_lm_lm_ptr_t ea_lm_lm_ptr_ea;
+__ea lm_ea_lm_ptr_t lm_ea_lm_ptr_ea;
+__ea ea_ea_lm_ptr_t ea_ea_lm_ptr_ea;
+__ea lm_lm_ea_ptr_t lm_lm_ea_ptr_ea;
+__ea ea_lm_ea_ptr_t ea_lm_ea_ptr_ea;
+__ea lm_ea_ea_ptr_t lm_ea_ea_ptr_ea;
+__ea ea_ea_ea_ptr_t ea_ea_ea_ptr_ea;
+#endif
+#endif
+#endif
+
+#if USE_COMPLEX
+#if LEVEL1
+#if USE_LOCAL_VAR
+__lm char *__lm lm_cptr;
+__ea char *__lm ea_cptr;
+#endif
+
+#if USE_EA_VAR
+__lm char *__ea lm_cptr_ea;
+__ea char *__ea ea_cptr_ea;
+#endif
+#endif
+
+#if LEVEL2
+#if USE_LOCAL_VAR
+__lm char *__lm *__lm lm_lm_cptr;
+__lm char *__ea *__lm ea_lm_cptr;
+__ea char *__lm *__lm lm_ea_cptr;
+__ea char *__ea *__lm ea_ea_cptr;
+#endif
+
+#if USE_EA_VAR
+__lm char *__lm *__ea lm_lm_cptr_ea;
+__lm char *__ea *__ea ea_lm_cptr_ea;
+__ea char *__lm *__ea lm_ea_cptr_ea;
+__ea char *__ea *__ea ea_ea_cptr_ea;
+#endif
+#endif
+
+#if LEVEL3
+#if USE_LOCAL_VAR
+__lm char *__lm *__lm *__lm lm_lm_lm_cptr;
+__lm char *__ea *__lm *__lm lm_ea_lm_cptr;
+__ea char *__lm *__lm *__lm lm_lm_ea_cptr;
+__ea char *__ea *__lm *__lm lm_ea_ea_cptr;
+__lm char *__lm *__ea *__lm ea_lm_lm_cptr;
+__lm char *__ea *__ea *__lm ea_ea_lm_cptr;
+__ea char *__lm *__ea *__lm ea_lm_ea_cptr;
+__ea char *__ea *__ea *__lm ea_ea_ea_cptr;
+#endif
+
+#if USE_EA_VAR
+__lm char *__lm *__lm *__ea lm_lm_lm_cptr_ea;
+__lm char *__ea *__lm *__ea lm_ea_lm_cptr_ea;
+__ea char *__lm *__lm *__ea lm_lm_ea_cptr_ea;
+__ea char *__ea *__lm *__ea lm_ea_ea_cptr_ea;
+__lm char *__lm *__ea *__ea ea_lm_lm_cptr_ea;
+__lm char *__ea *__ea *__ea ea_ea_lm_cptr_ea;
+__ea char *__lm *__ea *__ea ea_lm_ea_cptr_ea;
+__ea char *__ea *__ea *__ea ea_ea_ea_cptr_ea;
+#endif
+#endif
+#endif
+
+int
+main ()
+{
+  PRINT2 ("LEVEL1        = %d\n", LEVEL1);
+  PRINT2 ("LEVEL2        = %d\n", LEVEL2);
+  PRINT2 ("LEVEL3        = %d\n", LEVEL3);
+  PRINT2 ("USE_SIMPLE    = %d\n", USE_SIMPLE);
+  PRINT2 ("USE_COMPLEX   = %d\n", USE_COMPLEX);
+  PRINT2 ("USE_LOCAL_VAR = %d\n", USE_LOCAL_VAR);
+  PRINT2 ("USE_EA_VAR    = %d\n", USE_EA_VAR);
+  PRINT1 ("\n");
+
+#if USE_SIMPLE
+#if LEVEL1
+#if USE_LOCAL_VAR
+  TEST_SIZE ( lm_ptr, 4);
+  TEST_SIZE (*lm_ptr, 1);
+  TEST_SIZE ( ea_ptr, 8);
+  TEST_SIZE (*ea_ptr, 1);
+  PRINT1 ("\n");
+#endif
+
+#if USE_EA_VAR
+  TEST_SIZE ( lm_ptr_ea, 4);
+  TEST_SIZE (*lm_ptr_ea, 1);
+  TEST_SIZE ( ea_ptr_ea, 8);
+  TEST_SIZE (*ea_ptr_ea, 1);
+  PRINT1 ("\n");
+#endif
+#endif
+
+#if LEVEL2
+#if USE_LOCAL_VAR
+  TEST_SIZE (  lm_lm_ptr, 4);
+  TEST_SIZE ( *lm_lm_ptr, 4);
+  TEST_SIZE (**lm_lm_ptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (  lm_ea_ptr, 4);
+  TEST_SIZE ( *lm_ea_ptr, 8);
+  TEST_SIZE (**lm_ea_ptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (  ea_lm_ptr, 8);
+  TEST_SIZE ( *ea_lm_ptr, 4);
+  TEST_SIZE (**ea_lm_ptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (  ea_ea_ptr, 8);
+  TEST_SIZE ( *ea_ea_ptr, 8);
+  TEST_SIZE (**ea_ea_ptr, 1);
+  PRINT1 ("\n");
+#endif
+
+#if USE_EA_VAR
+  TEST_SIZE (  lm_lm_ptr_ea, 4);
+  TEST_SIZE ( *lm_lm_ptr_ea, 4);
+  TEST_SIZE (**lm_lm_ptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (  lm_ea_ptr_ea, 4);
+  TEST_SIZE ( *lm_ea_ptr_ea, 8);
+  TEST_SIZE (**lm_ea_ptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (  ea_lm_ptr_ea, 8);
+  TEST_SIZE ( *ea_lm_ptr_ea, 4);
+  TEST_SIZE (**ea_lm_ptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (  ea_ea_ptr_ea, 8);
+  TEST_SIZE ( *ea_ea_ptr_ea, 8);
+  TEST_SIZE (**ea_ea_ptr_ea, 1);
+  PRINT1 ("\n");
+#endif
+#endif
+
+#if LEVEL3
+#if USE_LOCAL_VAR
+  TEST_SIZE (   lm_lm_lm_ptr, 4);
+  TEST_SIZE (  *lm_lm_lm_ptr, 4);
+  TEST_SIZE ( **lm_lm_lm_ptr, 4);
+  TEST_SIZE (***lm_lm_lm_ptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   lm_lm_ea_ptr, 4);
+  TEST_SIZE (  *lm_lm_ea_ptr, 4);
+  TEST_SIZE ( **lm_lm_ea_ptr, 8);
+  TEST_SIZE (***lm_lm_ea_ptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   lm_ea_lm_ptr, 4);
+  TEST_SIZE (  *lm_ea_lm_ptr, 8);
+  TEST_SIZE ( **lm_ea_lm_ptr, 4);
+  TEST_SIZE (***lm_ea_lm_ptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   lm_ea_ea_ptr, 4);
+  TEST_SIZE (  *lm_ea_ea_ptr, 8);
+  TEST_SIZE ( **lm_ea_ea_ptr, 8);
+  TEST_SIZE (***lm_ea_ea_ptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   ea_lm_lm_ptr, 8);
+  TEST_SIZE (  *ea_lm_lm_ptr, 4);
+  TEST_SIZE ( **ea_lm_lm_ptr, 4);
+  TEST_SIZE (***ea_lm_lm_ptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   ea_lm_ea_ptr, 8);
+  TEST_SIZE (  *ea_lm_ea_ptr, 4);
+  TEST_SIZE ( **ea_lm_ea_ptr, 8);
+  TEST_SIZE (***ea_lm_ea_ptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   ea_ea_lm_ptr, 8);
+  TEST_SIZE (  *ea_ea_lm_ptr, 8);
+  TEST_SIZE ( **ea_ea_lm_ptr, 4);
+  TEST_SIZE (***ea_ea_lm_ptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   ea_ea_ea_ptr, 8);
+  TEST_SIZE (  *ea_ea_ea_ptr, 8);
+  TEST_SIZE ( **ea_ea_ea_ptr, 8);
+  TEST_SIZE (***ea_ea_ea_ptr, 1);
+  PRINT1 ("\n");
+#endif
+
+#if USE_EA_VAR
+  TEST_SIZE (   lm_lm_lm_ptr_ea, 4);
+  TEST_SIZE (  *lm_lm_lm_ptr_ea, 4);
+  TEST_SIZE ( **lm_lm_lm_ptr_ea, 4);
+  TEST_SIZE (***lm_lm_lm_ptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   lm_lm_ea_ptr_ea, 4);
+  TEST_SIZE (  *lm_lm_ea_ptr_ea, 4);
+  TEST_SIZE ( **lm_lm_ea_ptr_ea, 8);
+  TEST_SIZE (***lm_lm_ea_ptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   lm_ea_lm_ptr_ea, 4);
+  TEST_SIZE (  *lm_ea_lm_ptr_ea, 8);
+  TEST_SIZE ( **lm_ea_lm_ptr_ea, 4);
+  TEST_SIZE (***lm_ea_lm_ptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   lm_ea_ea_ptr_ea, 4);
+  TEST_SIZE (  *lm_ea_ea_ptr_ea, 8);
+  TEST_SIZE ( **lm_ea_ea_ptr_ea, 8);
+  TEST_SIZE (***lm_ea_ea_ptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   ea_lm_lm_ptr_ea, 8);
+  TEST_SIZE (  *ea_lm_lm_ptr_ea, 4);
+  TEST_SIZE ( **ea_lm_lm_ptr_ea, 4);
+  TEST_SIZE (***ea_lm_lm_ptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   ea_lm_ea_ptr_ea, 8);
+  TEST_SIZE (  *ea_lm_ea_ptr_ea, 4);
+  TEST_SIZE ( **ea_lm_ea_ptr_ea, 8);
+  TEST_SIZE (***ea_lm_ea_ptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   ea_ea_lm_ptr_ea, 8);
+  TEST_SIZE (  *ea_ea_lm_ptr_ea, 8);
+  TEST_SIZE ( **ea_ea_lm_ptr_ea, 4);
+  TEST_SIZE (***ea_ea_lm_ptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   ea_ea_ea_ptr_ea, 8);
+  TEST_SIZE (  *ea_ea_ea_ptr_ea, 8);
+  TEST_SIZE ( **ea_ea_ea_ptr_ea, 8);
+  TEST_SIZE (***ea_ea_ea_ptr_ea, 1);
+  PRINT1 ("\n");
+#endif
+#endif
+#endif
+
+#if USE_COMPLEX
+#if LEVEL1
+#if USE_LOCAL_VAR
+  TEST_SIZE ( lm_cptr, 4);
+  TEST_SIZE (*lm_cptr, 1);
+  TEST_SIZE ( ea_cptr, 8);
+  TEST_SIZE (*ea_cptr, 1);
+  PRINT1 ("\n");
+#endif
+
+#if USE_EA_VAR
+  TEST_SIZE ( lm_cptr_ea, 4);
+  TEST_SIZE (*lm_cptr_ea, 1);
+  TEST_SIZE ( ea_cptr_ea, 8);
+  TEST_SIZE (*ea_cptr_ea, 1);
+  PRINT1 ("\n");
+#endif
+#endif
+
+#if LEVEL2
+#if USE_LOCAL_VAR
+  TEST_SIZE (  lm_lm_cptr, 4);
+  TEST_SIZE ( *lm_lm_cptr, 4);
+  TEST_SIZE (**lm_lm_cptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (  lm_ea_cptr, 4);
+  TEST_SIZE ( *lm_ea_cptr, 8);
+  TEST_SIZE (**lm_ea_cptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (  ea_lm_cptr, 8);
+  TEST_SIZE ( *ea_lm_cptr, 4);
+  TEST_SIZE (**ea_lm_cptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (  ea_ea_cptr, 8);
+  TEST_SIZE ( *ea_ea_cptr, 8);
+  TEST_SIZE (**ea_ea_cptr, 1);
+  PRINT1 ("\n");
+#endif
+
+#if USE_EA_VAR
+  TEST_SIZE (  lm_lm_cptr_ea, 4);
+  TEST_SIZE ( *lm_lm_cptr_ea, 4);
+  TEST_SIZE (**lm_lm_cptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (  lm_ea_cptr_ea, 4);
+  TEST_SIZE ( *lm_ea_cptr_ea, 8);
+  TEST_SIZE (**lm_ea_cptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (  ea_lm_cptr_ea, 8);
+  TEST_SIZE ( *ea_lm_cptr_ea, 4);
+  TEST_SIZE (**ea_lm_cptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (  ea_ea_cptr_ea, 8);
+  TEST_SIZE ( *ea_ea_cptr_ea, 8);
+  TEST_SIZE (**ea_ea_cptr_ea, 1);
+  PRINT1 ("\n");
+#endif
+#endif
+
+#if LEVEL3
+#if USE_LOCAL_VAR
+  TEST_SIZE (   lm_lm_lm_cptr, 4);
+  TEST_SIZE (  *lm_lm_lm_cptr, 4);
+  TEST_SIZE ( **lm_lm_lm_cptr, 4);
+  TEST_SIZE (***lm_lm_lm_cptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   lm_lm_ea_cptr, 4);
+  TEST_SIZE (  *lm_lm_ea_cptr, 4);
+  TEST_SIZE ( **lm_lm_ea_cptr, 8);
+  TEST_SIZE (***lm_lm_ea_cptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   lm_ea_lm_cptr, 4);
+  TEST_SIZE (  *lm_ea_lm_cptr, 8);
+  TEST_SIZE ( **lm_ea_lm_cptr, 4);
+  TEST_SIZE (***lm_ea_lm_cptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   lm_ea_ea_cptr, 4);
+  TEST_SIZE (  *lm_ea_ea_cptr, 8);
+  TEST_SIZE ( **lm_ea_ea_cptr, 8);
+  TEST_SIZE (***lm_ea_ea_cptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   ea_lm_lm_cptr, 8);
+  TEST_SIZE (  *ea_lm_lm_cptr, 4);
+  TEST_SIZE ( **ea_lm_lm_cptr, 4);
+  TEST_SIZE (***ea_lm_lm_cptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   ea_lm_ea_cptr, 8);
+  TEST_SIZE (  *ea_lm_ea_cptr, 4);
+  TEST_SIZE ( **ea_lm_ea_cptr, 8);
+  TEST_SIZE (***ea_lm_ea_cptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   ea_ea_lm_cptr, 8);
+  TEST_SIZE (  *ea_ea_lm_cptr, 8);
+  TEST_SIZE ( **ea_ea_lm_cptr, 4);
+  TEST_SIZE (***ea_ea_lm_cptr, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   ea_ea_ea_cptr, 8);
+  TEST_SIZE (  *ea_ea_ea_cptr, 8);
+  TEST_SIZE ( **ea_ea_ea_cptr, 8);
+  TEST_SIZE (***ea_ea_ea_cptr, 1);
+  PRINT1 ("\n");
+#endif
+
+#if USE_EA_VAR
+  TEST_SIZE (   lm_lm_lm_cptr_ea, 4);
+  TEST_SIZE (  *lm_lm_lm_cptr_ea, 4);
+  TEST_SIZE ( **lm_lm_lm_cptr_ea, 4);
+  TEST_SIZE (***lm_lm_lm_cptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   lm_lm_ea_cptr_ea, 4);
+  TEST_SIZE (  *lm_lm_ea_cptr_ea, 4);
+  TEST_SIZE ( **lm_lm_ea_cptr_ea, 8);
+  TEST_SIZE (***lm_lm_ea_cptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   lm_ea_lm_cptr_ea, 4);
+  TEST_SIZE (  *lm_ea_lm_cptr_ea, 8);
+  TEST_SIZE ( **lm_ea_lm_cptr_ea, 4);
+  TEST_SIZE (***lm_ea_lm_cptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   lm_ea_ea_cptr_ea, 4);
+  TEST_SIZE (  *lm_ea_ea_cptr_ea, 8);
+  TEST_SIZE ( **lm_ea_ea_cptr_ea, 8);
+  TEST_SIZE (***lm_ea_ea_cptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   ea_lm_lm_cptr_ea, 8);
+  TEST_SIZE (  *ea_lm_lm_cptr_ea, 4);
+  TEST_SIZE ( **ea_lm_lm_cptr_ea, 4);
+  TEST_SIZE (***ea_lm_lm_cptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   ea_lm_ea_cptr_ea, 8);
+  TEST_SIZE (  *ea_lm_ea_cptr_ea, 4);
+  TEST_SIZE ( **ea_lm_ea_cptr_ea, 8);
+  TEST_SIZE (***ea_lm_ea_cptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   ea_ea_lm_cptr_ea, 8);
+  TEST_SIZE (  *ea_ea_lm_cptr_ea, 8);
+  TEST_SIZE ( **ea_ea_lm_cptr_ea, 4);
+  TEST_SIZE (***ea_ea_lm_cptr_ea, 1);
+  PRINT1 ("\n");
+
+  TEST_SIZE (   ea_ea_ea_cptr_ea, 8);
+  TEST_SIZE (  *ea_ea_ea_cptr_ea, 8);
+  TEST_SIZE ( **ea_ea_ea_cptr_ea, 8);
+  TEST_SIZE (***ea_ea_ea_cptr_ea, 1);
+  PRINT1 ("\n");
+#endif
+#endif
+#endif
+
+  if (errors)
+    {
+      PRINT3 ("%d error(s), %d test(s)\n", errors, num_tests);
+      abort ();
+    }
+  else
+    PRINT2 ("No errors, %d test(s)\n", num_tests);
+
+  return 0;
+}

-- 
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]