[llvm-commits] CVS: llvm/test/Programs/SingleSource/UnitTests/2003-05-26-Shorts.c
Chris Lattner
lattner at cs.uiuc.edu
Fri May 30 00:15:02 PDT 2003
Changes in directory llvm/test/Programs/SingleSource/UnitTests:
2003-05-26-Shorts.c updated: 1.1 -> 1.2
---
Log message:
Make the testcase work on X86
---
Diffs of the changes:
Index: llvm/test/Programs/SingleSource/UnitTests/2003-05-26-Shorts.c
diff -u llvm/test/Programs/SingleSource/UnitTests/2003-05-26-Shorts.c:1.1 llvm/test/Programs/SingleSource/UnitTests/2003-05-26-Shorts.c:1.2
--- llvm/test/Programs/SingleSource/UnitTests/2003-05-26-Shorts.c:1.1 Mon May 26 17:03:25 2003
+++ llvm/test/Programs/SingleSource/UnitTests/2003-05-26-Shorts.c Fri May 30 00:14:24 2003
@@ -7,15 +7,13 @@
* -- correct handling of high bits during native code generation for
* a sequence of operations involving -, * and /.
*/
-#include <stdlib.h>
#include <stdio.h>
-#include <sys/types.h>
int
main(int argc, char** argv)
{
- unsigned long UL = 0xafafafafc5c5b8a3;
- long L = (long) UL;
+ unsigned long long UL = 0xafafafafc5c5b8a3ULL;
+ long long L = (long long) UL;
unsigned int ui = (unsigned int) UL; /* 0xc5c5b8a3 = 3318069411 */
int i = (int) UL; /* 0xc5c5b8a3 = -976897885 */
@@ -23,32 +21,32 @@
unsigned short us = (unsigned short) UL; /* 0xb8a3 = 47267 */
short s = (short) UL; /* 0xb8a3 = -18269 */
- uint8_t ub = (uint8_t) UL; /* 0xa3 = 163 */
- int8_t b = ( int8_t) UL; /* 0xa3 = -93 */
+ unsigned char ub = (unsigned char) UL; /* 0xa3 = 163 */
+ signed char b = ( signed char) UL; /* 0xa3 = -93 */
- printf(" ui = %u (0x%x)\t\tUL-ui = %ld (0x%x)\n", ui, ui, UL-ui, UL-ui);
- printf("ui*ui = %u (0x%x)\t UL/ui = %ld (0x%x)\n\n",
+ printf(" ui = %u (0x%x)\t\tUL-ui = %lld (0x%llx)\n", ui, ui, UL-ui, UL-ui);
+ printf("ui*ui = %u (0x%x)\t UL/ui = %lld (0x%llx)\n\n",
(unsigned int) ui*ui, (unsigned int) ui*ui, UL/ui, UL/ui);
- printf(" i = %d (0x%x)\tL-i = %ld (0x%x)\n", i, i, L-i, L-i);
- printf(" i* i = %d (0x%x)\tL/ i = %ld (0x%x)\n\n",
+ printf(" i = %d (0x%x)\tL-i = %lld (0x%llx)\n", i, i, L-i, L-i);
+ printf(" i* i = %d (0x%x)\tL/ i = %lld (0x%llx)\n\n",
(int) i*i, (int) i*i, L/i, L/i);
- printf("us = %u (0x%x)\t\tUL-us = %ld (0x%x)\n", us, us, UL-us, UL-us);
- printf("us*us = %u (0x%x)\t UL/us = %ld (0x%x)\n\n",
+ printf("us = %u (0x%x)\t\tUL-us = %lld (0x%llx)\n", us, us, UL-us, UL-us);
+ printf("us*us = %u (0x%x)\t UL/us = %lld (0x%llx)\n\n",
(unsigned short) us*us, (unsigned short) us*us, UL/us, UL/us);
- printf(" s = %d (0x%x)\tL-s = %ld (0x%x)\n", s, s, L-s, L-s);
- printf(" s* s = %d (0x%x)\tL/ s = %ld (0x%x)\n\n",
+ printf(" s = %d (0x%x)\tL-s = %lld (0x%llx)\n", s, s, L-s, L-s);
+ printf(" s* s = %d (0x%x)\tL/ s = %lld (0x%llx)\n\n",
(short) s*s, (short) s*s, L/s, L/s);
- printf("ub = %u (0x%x)\t\tUL-ub = %ld (0x%x)\n", ub, ub, UL-ub, UL-ub);
- printf("ub*ub = %u (0x%x)\t\tUL/ub = %ld (0x%x)\n\n",
- (uint8_t) ub*ub, (uint8_t) ub*ub, UL/ub, UL/ub);
-
- printf(" b = %d (0x%x)\t\tL-b = %ld (0x%x)\n", b, b, L-b, L-b);
- printf(" b* b = %d (0x%x)\t\t\tL/b = %ld (0x%x)\n\n",
- (int8_t) b*b, (int8_t) b*b, L/b, L/b);
+ printf("ub = %u (0x%x)\t\tUL-ub = %lld (0x%llx)\n", ub, ub, UL-ub, UL-ub);
+ printf("ub*ub = %u (0x%x)\t\tUL/ub = %lld (0x%llx)\n\n",
+ (unsigned char) ub*ub, (unsigned char) ub*ub, UL/ub, UL/ub);
+
+ printf(" b = %d (0x%x)\t\tL-b = %lld (0x%llx)\n", b, b, L-b, L-b);
+ printf(" b* b = %d (0x%x)\t\t\tL/b = %lld (0x%llx)\n\n",
+ (signed char) b*b, (signed char) b*b, L/b, L/b);
return 0;
}
More information about the llvm-commits
mailing list