[llvm-commits] CVS: llvm/test/Programs/SingleSource/UnitTests/2003-10-29-ScalarReplBug.c
Chris Lattner
lattner at cs.uiuc.edu
Wed Oct 29 10:16:00 PST 2003
Changes in directory llvm/test/Programs/SingleSource/UnitTests:
2003-10-29-ScalarReplBug.c added (r1.1)
---
Log message:
New test program, contributed by Bill Wendling!
---
Diffs of the changes: (+33 -0)
Index: llvm/test/Programs/SingleSource/UnitTests/2003-10-29-ScalarReplBug.c
diff -c /dev/null llvm/test/Programs/SingleSource/UnitTests/2003-10-29-ScalarReplBug.c:1.1
*** /dev/null Wed Oct 29 10:15:50 2003
--- llvm/test/Programs/SingleSource/UnitTests/2003-10-29-ScalarReplBug.c Wed Oct 29 10:15:40 2003
***************
*** 0 ****
--- 1,33 ----
+ #include <stdio.h>
+
+ typedef struct {
+ char name [80];
+ int val;
+ unsigned uval;
+ } data;
+
+ static int callback(void *d);
+ static void iter(int (*)(void*), void *);
+
+ static int callback(void *d)
+ {
+ data *iter_data = (data *)d;
+
+ printf("%u\n", iter_data->uval);
+ return iter_data->uval == 0;
+ }
+
+ static void iter(int (*cb)(void*), void *d)
+ {
+ cb(d);
+ }
+
+ int main()
+ {
+ data d;
+
+ d.uval = 0;
+ iter(callback, &d);
+ }
+
+
More information about the llvm-commits
mailing list