Browse Source

Patch from David Schleef to check for proper 16-byte aliged
stack pointer on powerpc

Eric Andersen 22 years ago
parent
commit
5b470cfcc3
1 changed files with 10 additions and 0 deletions
  1. 10 0
      test/args/arg_test.c

+ 10 - 0
test/args/arg_test.c

@@ -29,6 +29,16 @@ int main( int argc, char **argv)
 {
 	int i=0;
 	char** index=__environ;
+
+#ifdef __powerpc__
+	{
+		unsigned long sp;
+		sp = (unsigned long) __builtin_frame_address(0);
+		if(sp&0xf){
+			fprintf(stderr, "stack pointer is unaligned! (%08lx)\n", sp);
+		}
+	}
+#endif
 	
 	fprintf(stderr, "argc=%d\n", argc);