[llvm-commits] CVS: llvm/test/Programs/SingleSource/Regression/C/2004-01-01-UnknownInitSize.c

John Criswell criswell at cs.uiuc.edu
Thu Jan 1 19:52:01 PST 2004


Changes in directory llvm/test/Programs/SingleSource/Regression/C:

2004-01-01-UnknownInitSize.c added (r1.1)

---
Log message:

Regression test that verifies that initializers with unknown initial sizes
are compiled correctly.
Second test case of 2004!



---
Diffs of the changes:  (+25 -0)

Index: llvm/test/Programs/SingleSource/Regression/C/2004-01-01-UnknownInitSize.c
diff -c /dev/null llvm/test/Programs/SingleSource/Regression/C/2004-01-01-UnknownInitSize.c:1.1
*** /dev/null	Thu Jan  1 19:51:40 2004
--- llvm/test/Programs/SingleSource/Regression/C/2004-01-01-UnknownInitSize.c	Thu Jan  1 19:51:30 2004
***************
*** 0 ****
--- 1,25 ----
+ /*
+  * This regression test ensures that the C front end can compile initializers
+  * correctly when their size is not static.
+  */
+ struct one
+ {
+   int a;
+   int values [];
+ };
+ 
+ struct one hobbit = {5, {1, 2, 3}};
+ 
+ int
+ main ()
+ {
+   int index;
+ 
+   for (index=0; index < 3; index++)
+   {
+     printf ("%d\n", hobbit.values[index]);
+   }
+ 
+   return 0;
+ }
+ 





More information about the llvm-commits mailing list