[llvm-commits] CVS: llvm/test/Programs/SingleSource/UnitTests/2003-04-22-Switch.c

Chris Lattner lattner at cs.uiuc.edu
Wed Apr 23 11:19:04 PDT 2003


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

2003-04-22-Switch.c updated: 1.1 -> 1.2

---
Log message:

Make testcase more interesting by making PHI nodes occur due to the switch


---
Diffs of the changes:

Index: llvm/test/Programs/SingleSource/UnitTests/2003-04-22-Switch.c
diff -u llvm/test/Programs/SingleSource/UnitTests/2003-04-22-Switch.c:1.1 llvm/test/Programs/SingleSource/UnitTests/2003-04-22-Switch.c:1.2
--- llvm/test/Programs/SingleSource/UnitTests/2003-04-22-Switch.c:1.1	Tue Apr 22 15:25:58 2003
+++ llvm/test/Programs/SingleSource/UnitTests/2003-04-22-Switch.c	Wed Apr 23 11:18:37 2003
@@ -1,17 +1,19 @@
 
 #include <stdio.h>
 
-static void func(unsigned i) {
+static int func(unsigned i) {
+  int X = 4;
   switch (i) {
-  case 8: printf("C\n"); /* fall through. */
+  case 8: printf("C\n"); /* fall through. */  X = 6;
   case 0:
-  case 3:
+  case 3: 
   case 2: printf("A\n"); break;
   case 1:
-  case 7:
+  case 7: X = 7;
   case 9: printf("B\n"); break;
-  default: printf("D\n");
+  default: printf("D\n"); X = 1;
   }
+  return X;
 }
 
 





More information about the llvm-commits mailing list