[llvm-commits] CVS: llvm/test/Programs/SingleSource/UnitTests/2003-05-07-VarArgs.c

Chris Lattner lattner at cs.uiuc.edu
Thu May 8 14:45:01 PDT 2003


Changes in directory llvm/test/Programs/SingleSource/UnitTests:

2003-05-07-VarArgs.c updated: 1.2 -> 1.3

---
Log message:

Beef up the test a bit


---
Diffs of the changes:

Index: llvm/test/Programs/SingleSource/UnitTests/2003-05-07-VarArgs.c
diff -u llvm/test/Programs/SingleSource/UnitTests/2003-05-07-VarArgs.c:1.2 llvm/test/Programs/SingleSource/UnitTests/2003-05-07-VarArgs.c:1.3
--- llvm/test/Programs/SingleSource/UnitTests/2003-05-07-VarArgs.c:1.2	Wed May  7 22:15:31 2003
+++ llvm/test/Programs/SingleSource/UnitTests/2003-05-07-VarArgs.c	Thu May  8 14:43:55 2003
@@ -17,10 +17,16 @@
       s = va_arg(ap, char *);
       printf("string %s\n", s);
       break;
-    case 'd':           /* int */
+    case 'i':           /* int */
       d = va_arg(ap, int);
       printf("int %d\n", d);
       break;
+    case 'd':
+      printf("double %f\n", va_arg(ap, double));
+      break;
+    case 'l':
+      printf("long long %lld\n", va_arg(ap, long long));
+      break;
     case 'c':           /* char */
       /* need a cast here since va_arg only
          takes fully promoted types */
@@ -32,6 +38,9 @@
 }
 
 int main() {
-  test("ssdcd", "abc", "def", -123, 'a', 123);
+  test("ssici", "abc", "def", -123, 'a', 123);
+
+  /* test promotion & 64-bit types */
+  test("ddil", 1.0, 2.0f, (short)32764, 12345677823423LL);
   return 0;
 }





More information about the llvm-commits mailing list