浏览代码

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

Eric Andersen 22 年之前
父节点
当前提交
5b470cfcc3
共有 1 个文件被更改,包括 10 次插入0 次删除
  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);