// RUN: %ucc -o %t %s
// RUN: %ocheck 0 %t
// RUN: %t | %output_check 'Hello 5 5.9' '7.3 8.7 10.1 11.5 12.9 14.3 15.7 17.1 18.5 19.9' 'Hello 5 15.7' '14.3 12.9 11.5 10.1 8.7 7.3 5.9 4.5 3.1 1.7 0.3'


// should run without segfaulting
main()
{
	printf("Hello %d %.1f\n"
			"%.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f\n",
			5,
			5.9,
			7.3,
			8.7,
			10.1,
			11.5,
			12.9,
			14.3,
			15.7,
			17.1,
			18.5,
			19.9); // this causes an infinite loop in glibc's printf()

	printf("Hello %d %.1f\n"
			"%.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f\n",
			5,
			15.7,
			14.3,
			12.9,
			11.5,
			10.1,
			8.7,
			7.3,
			5.9,
			4.5,
			3.1,
			1.7, // this causes an infinite loop in glibc's printf()
			0.3); // and this causes a crash


	// suspect the bug is to do with double alignment when passed as stack arguments

	return 0;
}

// RUN: %ucc -o %t %s
// RUN: %ocheck 0 %t
// RUN: %t | %output_check 'Hello 5 2.3' 'Hello 5 2.3'

// should run without segfaulting
main()
{
	printf("Hello %d %.1f\n",
			5,
			2.3,
			2.3,
			2.3,
			2.3,
			2.3,
			2.3,
			2.3,
			2.3,
			2.3,
			2.3,
			2.3); // this causes an infinite loop in glibc's printf()

	printf("Hello %d %.1f\n",
			5,
			2.3,
			2.3,
			2.3,
			2.3,
			2.3,
			2.3,
			2.3,
			2.3,
			2.3,
			2.3,
			2.3,  // this causes an infinite loop in glibc's printf()
			2.3); // and this causes a crash


	// suspect the bug is to do with double alignment when passed as stack arguments

	return 0;
}

--- 
+++ 
@@ -1,38 +1,41 @@
 // RUN: %ucc -o %t %s
 // RUN: %ocheck 0 %t
-// RUN: %t | %output_check 'Hello 5 2.3' 'Hello 5 2.3'
+// RUN: %t | %output_check 'Hello 5 5.9' '7.3 8.7 10.1 11.5 12.9 14.3 15.7 17.1 18.5 19.9' 'Hello 5 15.7' '14.3 12.9 11.5 10.1 8.7 7.3 5.9 4.5 3.1 1.7 0.3'
+
 
 // should run without segfaulting
 main()
 {
-	printf("Hello %d %.1f\n",
+	printf("Hello %d %.1f\n"
+			"%.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f\n",
 			5,
-			2.3,
-			2.3,
-			2.3,
-			2.3,
-			2.3,
-			2.3,
-			2.3,
-			2.3,
-			2.3,
-			2.3,
-			2.3); // this causes an infinite loop in glibc's printf()
+			5.9,
+			7.3,
+			8.7,
+			10.1,
+			11.5,
+			12.9,
+			14.3,
+			15.7,
+			17.1,
+			18.5,
+			19.9); // this causes an infinite loop in glibc's printf()
 
-	printf("Hello %d %.1f\n",
+	printf("Hello %d %.1f\n"
+			"%.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f\n",
 			5,
-			2.3,
-			2.3,
-			2.3,
-			2.3,
-			2.3,
-			2.3,
-			2.3,
-			2.3,
-			2.3,
-			2.3,
-			2.3,  // this causes an infinite loop in glibc's printf()
-			2.3); // and this causes a crash
+			15.7,
+			14.3,
+			12.9,
+			11.5,
+			10.1,
+			8.7,
+			7.3,
+			5.9,
+			4.5,
+			3.1,
+			1.7, // this causes an infinite loop in glibc's printf()
+			0.3); // and this causes a crash
 
 
 	// suspect the bug is to do with double alignment when passed as stack arguments
Format strings and more through test for stack floats
