--- old/usr/src/test/libc-tests/tests/newlocale/newlocale_test.c	Sat Jul 12 19:07:45 2014
+++ new/usr/src/test/libc-tests/tests/newlocale/newlocale_test.c	Sat Jul 12 19:07:45 2014
@@ -58,7 +58,7 @@
 {
 	va_list args;
 
-	(void) printf("TEST STARTING %s: ", testName);
+	(void) printf("TEST STARTING %s (%s): ", testName, ARCH);
 
 	va_start(args, format);
 	(void) vprintf(format, args);
@@ -71,11 +71,12 @@
 {
 	va_list args;
 
-	(void) printf("TEST FAILED %s: ", testName);
+	(void) printf("TEST FAILED %s (%s): ", testName, ARCH);
 
 	va_start(args, format);
 	(void) vprintf(format, args);
 	va_end(args);
+	(void) printf("\n");
 
 	(void) exit(-1);
 }
@@ -83,12 +84,12 @@
 static void
 test_passed(const char *testName)
 {
-	(void) printf("TEST PASS: %s\n", testName);
+	(void) printf("TEST PASS: %s (%s)\n", testName, ARCH);
 	(void) fflush(stdout);
 }
 
 void *
-testlocale_thr(void *ptr)
+testlocale_thr_one(void *ptr)
 {
 	locale_t	cloc, loc;
 	struct lconv	*lc;
@@ -156,15 +157,15 @@
 
 
 void
-testlocale(void)
+test_newlocale_threaded(void)
 {
-	char		*tname = "newlocale/uselocale";
+	char		*tname = "newlocale_threaded";
 	pthread_t	tid[NUMTHR];
 
 	test_start(tname, "running %d threads %d iterations\n", NUMTHR, NUMITR);
 
 	for (int i = 0; i < NUMTHR; i++) {
-		(void) pthread_create(&tid[i], NULL, testlocale_thr, tname);
+		(void) pthread_create(&tid[i], NULL, testlocale_thr_one, tname);
 	}
 
 	for (int i = 0; i < NUMTHR; i++) {
@@ -173,6 +174,102 @@
 	test_passed(tname);
 }
 
+void
+test_newlocale_negative(void)
+{
+	
+	locale_t loc, bad;
+	char *day;
+	char *tname = "newlocale_negative";
+
+	test_start(tname, "verify proper failure handling\n");
+	loc = newlocale(LC_ALL_MASK, "de_DE.UTF-8", NULL);
+	if (loc == NULL) {
+		test_failed(tname, "cannot set de_DE.UTF-8");
+	}
+	day = nl_langinfo_l(DAY_1, loc);
+	if (strcmp(day, "Sonntag") != 0) {
+		test_failed(tname, "incorrect Sonntag != %s", day);
+	}
+
+	bad = newlocale(LC_ALL_MASK, "cn_US.BIZRRE", loc);
+	if (bad != NULL) {
+		test_failed(tname, "passed setting bogus locale");
+	}
+	day = nl_langinfo_l(DAY_1, loc);
+	if (strcmp(day, "Sonntag") != 0) {
+		test_failed(tname, "incorrect Sonntag != %s", day);
+	}
+	test_passed(tname);
+}
+
+void
+test_newlocale_categories(void)
+{
+	locale_t loc;
+	char *day, *cur, *yes;
+	char *tname = "newlocale_categories";
+
+	test_start(tname, "verify different category behavior\n");
+
+	loc = NULL;
+	loc = newlocale(LC_TIME_MASK, "de_DE.UTF-8", loc);
+	loc = newlocale(LC_MESSAGES_MASK, "ru_RU.UTF-8", loc);
+	loc = newlocale(LC_MONETARY_MASK, "en_US.UTF-8", loc);
+
+	if (loc == NULL) {
+		test_failed(tname, "failed to set locale");
+	}
+
+	day = nl_langinfo_l(DAY_1, loc);
+	if ((day == NULL) || (strcmp(day, "Sonntag") != 0)) {
+		test_failed(tname, "day1 mismatch %s != %s", day, "Sonntag");
+	}
+	yes = nl_langinfo_l(YESSTR, loc);
+	if ((yes == NULL) || (strcmp(yes, "да") != 0)) {
+		test_failed(tname, "currency mismatch");
+	}
+	cur = nl_langinfo_l(CRNCYSTR, loc);
+	if ((cur == NULL) || (strcmp(cur, "-$") != 0)) {
+		test_failed(tname, "currency mismatch [%s] != [%s]", cur, "-$");
+	}
+
+	test_passed(tname);
+}
+
+void
+test_newlocale_composite(void)
+{
+	locale_t loc;
+	char *day, *cur, *yes;
+	char *tname = "newlocale_composite";
+
+	test_start(tname, "verify composite locale behavior\n");
+
+	/* order: CTYPE/NUMERIC/TIME/COLLATE/MONETARY/MESSAGES */
+	loc = newlocale(LC_ALL_MASK,
+	    "C/C/de_DE.UTF-8/C/en_US.UTF-8/ru_RU.UTF-8", NULL);
+
+	if (loc == NULL) {
+		test_failed(tname, "failed to set composite locale");
+	}
+
+	day = nl_langinfo_l(DAY_1, loc);
+	if ((day == NULL) || (strcmp(day, "Sonntag") != 0)) {
+		test_failed(tname, "day1 mismatch %s != %s", day, "Sonntag");
+	}
+	yes = nl_langinfo_l(YESSTR, loc);
+	if ((yes == NULL) || (strcmp(yes, "да") != 0)) {
+		test_failed(tname, "currency mismatch");
+	}
+	cur = nl_langinfo_l(CRNCYSTR, loc);
+	if ((cur == NULL) || (strcmp(cur, "-$") != 0)) {
+		test_failed(tname, "currency mismatch [%s] != [%s]", cur, "-$");
+	}
+
+	test_passed(tname);
+}
+
 int
 main(int argc, char **argv)
 {
@@ -189,7 +286,10 @@
 		}
 	}
 
-	testlocale();
+	test_newlocale_threaded();
+	test_newlocale_negative();
+	test_newlocale_categories();
+	test_newlocale_composite();
 
 	exit(0);
 }
