--- old/usr/src/common/saveargs/tests/testmatch/testmatch.c	2013-02-22 23:58:09.120524898 -0500
+++ new/usr/src/common/saveargs/tests/testmatch/testmatch.c	2013-02-22 23:58:09.224111948 -0500
@@ -24,31 +24,55 @@
 #define	SIZE_OF(name) ((caddr_t)&name##_end - (caddr_t)&name)
 
 #define	TEST_GOOD(name, argc)					\
-    if (saveargs_has_args(name, SIZE_OF(name), argc, 0) != 0)	\
-	printf("Pass: %s\n", #name);				\
-    else							\
-	printf("FAIL: %s\n", #name);
+	if (saveargs_has_args(name, SIZE_OF(name), argc, 0) ==	\
+	    SAVEARGS_TRAD_ARGS)					\
+		printf("Pass: %s\n", #name);			\
+	else							\
+		printf("FAIL: %s\n", #name);
 
 #define	TEST_GOOD_STRUCT(name, argc)				\
-    if (saveargs_has_args(name, SIZE_OF(name), argc, 1) != 0)	\
-	printf("Pass: %s\n", #name);				\
-    else							\
-	printf("FAIL: %s\n", #name);
+	if (saveargs_has_args(name, SIZE_OF(name), argc, 1) ==	\
+	    SAVEARGS_STRUCT_ARGS)				\
+		printf("Pass: %s\n", #name);			\
+	else							\
+		printf("FAIL: %s\n", #name);
+
+/*
+ * GCC deals with structures differently, so TRAD args is actually correct for
+ * this
+ */
+#define	TEST_GOOD_GSTRUCT(name, argc)				\
+	if (saveargs_has_args(name, SIZE_OF(name), argc, 1) ==	\
+	    SAVEARGS_TRAD_ARGS)					\
+		printf("Pass: %s\n", #name);			\
+	else							\
+		printf("FAIL: %s\n", #name);
 
 #define	TEST_BAD(name, argc)					\
-    if (saveargs_has_args(name, SIZE_OF(name), argc, 0) == 0)	\
-	printf("Pass: %s\n", #name);				\
-    else							\
-	printf("FAIL: %s\n", #name);
+	if (saveargs_has_args(name, SIZE_OF(name), argc, 0) == 	\
+		SAVEARGS_NO_ARGS)				\
+		printf("Pass: %s\n", #name);			\
+	else							\
+		printf("FAIL: %s\n", #name);
 
 #define	TEST_BAD_STRUCT(name, argc)				\
-    if (saveargs_has_args(name, SIZE_OF(name), argc, 1) == 0)	\
-	printf("Pass: %s\n", #name);				\
-    else							\
-	printf("FAIL: %s\n", #name);
+	if (saveargs_has_args(name, SIZE_OF(name), argc, 1) == 	\
+		SAVEARGS_NO_ARGS)				\
+		printf("Pass: %s\n", #name);			\
+	else							\
+		printf("FAIL: %s\n", #name);
+
+#define	TEST_BAD_GSTRUCT(name, argc)				\
+	if (saveargs_has_args(name, SIZE_OF(name), argc, 1) == 	\
+		SAVEARGS_NO_ARGS)				\
+		printf("Pass: %s\n", #name);			\
+	else							\
+		printf("FAIL: %s\n", #name);
 
 DEF_TEST(gcc_mov_align);
 DEF_TEST(gcc_mov_basic);
+DEF_TEST(gcc_mov_noorder);
+DEF_TEST(gcc_mov_struct_noorder);
 DEF_TEST(gcc_mov_big_struct_ret);
 DEF_TEST(gcc_mov_big_struct_ret_and_spill);
 DEF_TEST(gcc_mov_small_struct_ret);
@@ -57,6 +81,8 @@
 
 DEF_TEST(gcc_push_align);
 DEF_TEST(gcc_push_basic);
+DEF_TEST(gcc_push_noorder);
+DEF_TEST(gcc_push_struct_noorder);
 DEF_TEST(gcc_push_big_struct_ret);
 DEF_TEST(gcc_push_big_struct_ret_and_spill);
 DEF_TEST(gcc_push_small_struct_ret);
@@ -79,6 +105,8 @@
 DEF_TEST(small_struct_ret_w_float);
 DEF_TEST(big_struct_ret_w_float);
 
+DEF_TEST(interleaved_argument_saves);
+
 /*
  * Functions which should not match
  *
@@ -97,7 +125,7 @@
 	TEST_GOOD(uts_kill, 2);
 	TEST_GOOD(av1394_ic_bitreverse, 1);
 	TEST_GOOD(dtrace_instrumented, 4);
-	TEST_GOOD_STRUCT(big_struct_ret_w_float, 1);
+	TEST_GOOD_GSTRUCT(big_struct_ret_w_float, 1);
 	TEST_BAD(no_fp, 5);
 
 	TEST_GOOD(gcc_mov_align, 5);
@@ -108,12 +136,18 @@
 	TEST_GOOD(gcc_push_basic, 4);
 	TEST_GOOD(ss_mov_basic, 4);
 
-	TEST_GOOD_STRUCT(gcc_mov_big_struct_ret, 4);
-	TEST_GOOD_STRUCT(gcc_push_big_struct_ret, 4);
+	TEST_GOOD(gcc_mov_noorder, 4);
+	TEST_GOOD(gcc_push_noorder, 4);
+
+	TEST_GOOD_GSTRUCT(gcc_mov_big_struct_ret, 4);
+	TEST_GOOD_GSTRUCT(gcc_push_big_struct_ret, 4);
 	TEST_GOOD_STRUCT(ss_mov_big_struct_ret, 4);
 
-	TEST_GOOD_STRUCT(gcc_mov_big_struct_ret_and_spill, 8);
-	TEST_GOOD_STRUCT(gcc_push_big_struct_ret_and_spill, 8);
+	TEST_GOOD_GSTRUCT(gcc_mov_struct_noorder, 4);
+	TEST_GOOD_GSTRUCT(gcc_push_struct_noorder, 4);
+
+	TEST_GOOD_GSTRUCT(gcc_mov_big_struct_ret_and_spill, 8);
+	TEST_GOOD_GSTRUCT(gcc_push_big_struct_ret_and_spill, 8);
 	TEST_GOOD_STRUCT(ss_mov_big_struct_ret_and_spill, 8);
 
 	TEST_GOOD(gcc_mov_small_struct_ret, 4);
@@ -133,5 +167,7 @@
 
 	TEST_BAD(small_struct_ret_w_float, 1);
 
+	TEST_GOOD(interleaved_argument_saves, 4);
+
 	return (0);
 }
