[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/union2.c union2.reference_output

Reid Spencer reid at x10sys.com
Mon May 14 00:38:41 PDT 2007



Changes in directory llvm-test/SingleSource/UnitTests/Integer:

union2.c updated: 1.6 -> 1.7
union2.reference_output updated: 1.2 -> 1.3
---
Log message:

Update the output of this test slight and make it pass the union value
through a function call.


---
Diffs of the changes:  (+13 -13)

 union2.c                |   20 ++++++++++----------
 union2.reference_output |    6 +++---
 2 files changed, 13 insertions(+), 13 deletions(-)


Index: llvm-test/SingleSource/UnitTests/Integer/union2.c
diff -u llvm-test/SingleSource/UnitTests/Integer/union2.c:1.6 llvm-test/SingleSource/UnitTests/Integer/union2.c:1.7
--- llvm-test/SingleSource/UnitTests/Integer/union2.c:1.6	Wed Jan 24 14:39:44 2007
+++ llvm-test/SingleSource/UnitTests/Integer/union2.c	Mon May 14 02:38:23 2007
@@ -22,22 +22,18 @@
 typedef union {short i; int9 i9; int31 i31;} myUnion;
 typedef struct myStruct {int9* ptr; short i;} myStruct;
 
-myStruct test(myUnion u)
+myStruct test(myUnion *u)
 {
   myStruct x;
   int9* ptr;
   
-  u.i31 = -1;
-  u.i = 0x0;
-  ptr = &(u.i9);
+  u->i31 = -1;
+  u->i = 0x0;
+  ptr = &(u->i9);
   *ptr= -1;
 
-  printf("u.i = %hd\n", u.i);
-  printf("u.i9 = %hd\n", u.i9);
-  printf("u.i31 = %d\n", u.i31);
- 
   x.ptr = ptr;
-  x.i = u.i;
+  x.i = u->i;
 
   return x;   
 }
@@ -46,7 +42,11 @@
 
 int main()
 {
-  myStruct s = test(uu);
+  myStruct s = test(&uu);
+  printf("uu.i  = %hd\n", uu.i);
+  printf("uu.i9 = %d\n", (int)uu.i9);
+  printf("uu.i31= %d\n", uu.i31);
+ 
   if(s.i == 0x0)
     printf("error: s.i=%x\n", s.i);
   return 0;


Index: llvm-test/SingleSource/UnitTests/Integer/union2.reference_output
diff -u llvm-test/SingleSource/UnitTests/Integer/union2.reference_output:1.2 llvm-test/SingleSource/UnitTests/Integer/union2.reference_output:1.3
--- llvm-test/SingleSource/UnitTests/Integer/union2.reference_output:1.2	Wed Jan 24 14:39:44 2007
+++ llvm-test/SingleSource/UnitTests/Integer/union2.reference_output	Mon May 14 02:38:23 2007
@@ -1,4 +1,4 @@
-u.i = 511
-u.i9 = -1
-u.i31 = -65025
+uu.i  = 511
+uu.i9 = -1
+uu.i31= -65025
 exit 0






More information about the llvm-commits mailing list