[llvm-commits] CVS: llvm/test/Programs/SingleSource/UnitTests/2003-05-31-CastToBool.c
Chris Lattner
lattner at cs.uiuc.edu
Sat May 31 22:32:00 PDT 2003
Changes in directory llvm/test/Programs/SingleSource/UnitTests:
2003-05-31-CastToBool.c added (r1.1)
---
Log message:
New testcase
---
Diffs of the changes:
Index: llvm/test/Programs/SingleSource/UnitTests/2003-05-31-CastToBool.c
diff -c /dev/null llvm/test/Programs/SingleSource/UnitTests/2003-05-31-CastToBool.c:1.1
*** /dev/null Sat May 31 22:31:15 2003
--- llvm/test/Programs/SingleSource/UnitTests/2003-05-31-CastToBool.c Sat May 31 22:31:05 2003
***************
*** 0 ****
--- 1,38 ----
+ #include <stdio.h>
+ void testBool(_Bool X) {
+ printf("%d\n", X);
+ }
+
+ void testByte(char X) {
+ printf("%d ", X);
+ testBool(X != 0);
+ }
+
+ void testShort(short X) {
+ printf("%d ", X);
+ testBool(X != 0);
+ }
+
+ void testInt(int X) {
+ printf("%d ", X);
+ testBool(X != 0);
+ }
+
+ void testLong(long long X) {
+ printf("%d ", X);
+ testBool(X != 0);
+ }
+
+ int main() {
+ testByte(0);
+ testByte(123);
+ testShort(0);
+ testShort(1234);
+ testInt(0);
+ testInt(1234);
+ testLong(0);
+ testLong(123121231231231LL);
+ testLong(0x1112300000000000LL);
+ testLong(0x11120LL);
+ return 0;
+ }
More information about the llvm-commits
mailing list