]> git.gag.com Git - fw/sdcc/blobdiff - support/regression/tests/bug1273984.c
* Fixed svn:eol-style and svn:keywords properties
[fw/sdcc] / support / regression / tests / bug1273984.c
index 1006a307802784a9bc4d08a06b0f1e3a790c66cb..d371d61351e724bdf6c783eaa8a5e38de82531fa 100644 (file)
@@ -1,43 +1,43 @@
-/*  An assignment inside a functioncall changed the type of the parameter.\r
-    See bug description 1273984 for details.\r
-\r
-    Bug detected and fixed by Guenther Jehle\r
-\r
-    sign: unsigned,\r
- */\r
-\r
-#include <testfwk.h>\r
-\r
-void foo({sign} int val) {\r
-  val; //make the compiler happy\r
-}\r
-\r
-void fooInt({sign} int val) {\r
-  ASSERT(val==3);\r
-}\r
-\r
-void fooChar({sign} char val) {\r
-  ASSERT(val==6);\r
-}\r
-\r
-void\r
-testAssignInFunctioncall(void)\r
-{\r
-  volatile {sign} char charVal=3;\r
-  volatile {sign} int intVal=0x4040;\r
-\r
-  fooInt(intVal=charVal); // should cast charVal to int for function call.\r
-                          // without patch #1645121, a char is put on the stack\r
-                          // (or hold in registers)\r
-  foo(0xAAAA);\r
-  fooInt(intVal=charVal);\r
-\r
-  intVal=6;\r
-\r
-  fooChar(charVal=intVal); // without patch, a int is put on the stack\r
-  foo(0xAAAA);\r
-  fooChar(charVal=intVal);\r
-\r
-}\r
-\r
-\r
+/*  An assignment inside a functioncall changed the type of the parameter.
+    See bug description 1273984 for details.
+
+    Bug detected and fixed by Guenther Jehle
+
+    sign: unsigned,
+ */
+
+#include <testfwk.h>
+
+void foo({sign} int val) {
+  val; //make the compiler happy
+}
+
+void fooInt({sign} int val) {
+  ASSERT(val==3);
+}
+
+void fooChar({sign} char val) {
+  ASSERT(val==6);
+}
+
+void
+testAssignInFunctioncall(void)
+{
+  volatile {sign} char charVal=3;
+  volatile {sign} int intVal=0x4040;
+
+  fooInt(intVal=charVal); // should cast charVal to int for function call.
+                          // without patch #1645121, a char is put on the stack
+                          // (or hold in registers)
+  foo(0xAAAA);
+  fooInt(intVal=charVal);
+
+  intVal=6;
+
+  fooChar(charVal=intVal); // without patch, a int is put on the stack
+  foo(0xAAAA);
+  fooChar(charVal=intVal);
+
+}
+
+