[llvm-commits] CVS: llvm/test/Programs/SingleSource/UnitTests/2002-05-02-CastTest.c
Nicholas Hildenbrandt
hldnbrnd at cs.uiuc.edu
Fri Oct 4 18:46:00 PDT 2002
Changes in directory llvm/test/Programs/SingleSource/UnitTests:
2002-05-02-CastTest.c updated: 1.3 -> 1.4
---
Log message:
Changed to be linux friendly
---
Diffs of the changes:
Index: llvm/test/Programs/SingleSource/UnitTests/2002-05-02-CastTest.c
diff -u llvm/test/Programs/SingleSource/UnitTests/2002-05-02-CastTest.c:1.3 llvm/test/Programs/SingleSource/UnitTests/2002-05-02-CastTest.c:1.4
--- llvm/test/Programs/SingleSource/UnitTests/2002-05-02-CastTest.c:1.3 Wed Aug 21 22:21:39 2002
+++ llvm/test/Programs/SingleSource/UnitTests/2002-05-02-CastTest.c Fri Oct 4 18:45:32 2002
@@ -2,6 +2,11 @@
#include <stdio.h>
#include <sys/types.h>
+/* Linux defines these in stdint.h, sun might not have that file, don't mess
+ around when it's this easy to fix */
+typedef unsigned char uint8;
+typedef signed char int8;
+
int
main(int argc, char** argv)
{
@@ -9,11 +14,11 @@
short s1 = (argc >= 3)? atoi(argv[2]) : -769; /* 0xfcff = -769 */
unsigned char ubc0 = (unsigned char) c1; /* 100 = 'd' */
- uint8_t ubs0 = (uint8_t) s1; /* 0xff = 255 */
- uint8_t ubs1 = ubs0+1; /* ((uint8_t) 0xff) + 1) = 0 */
+ uint8 ubs0 = (uint8) s1; /* 0xff = 255 */
+ uint8 ubs1 = ubs0+1; /* ((uint8) 0xff) + 1) = 0 */
- int8_t bs0 = (int8_t) ubs0; /* (int8_t) 0xff = -1 */
- int8_t bs1 = (int8_t) (ubs0 + 1U); /* (int8_t) (0xff + 0x1) = 0 */
+ int8 bs0 = (int8) ubs0; /* (int8) 0xff = -1 */
+ int8 bs1 = (int8) (ubs0 + 1U); /* (int8) (0xff + 0x1) = 0 */
unsigned char uc2 = (unsigned char) c1; /* 100 = 'd' */
unsigned short us2 = (unsigned short) s1; /* 0xfcff = 64767 */
More information about the llvm-commits
mailing list