Changes in directory llvm-test/SingleSource/UnitTests/Integer:
trunc.c added (r1.1) trunc.reference_output added (r1.1) general-test.c updated: 1.5 -> 1.6 matrix.c updated: 1.7 -> 1.8 matrix.h updated: 1.1 -> 1.2 matrix.reference_output updated: 1.2 -> 1.3 --- Log message: Add trunc.c for cbe test. Modify matrix.c to avoid overflow problem. --- Diffs of the changes: (+71 -17) general-test.c | 2 - matrix.c | 14 ++++++------- matrix.h | 2 - matrix.reference_output | 16 +++++++-------- trunc.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ trunc.reference_output | 4 +++ 6 files changed, 71 insertions(+), 17 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/trunc.c diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/trunc.c:1.1 *** /dev/null Thu Jan 25 21:10:27 2007 --- llvm-test/SingleSource/UnitTests/Integer/trunc.c Thu Jan 25 21:10:17 2007 *************** *** 0 **** --- 1,50 ---- + //===--- trunc.c --- Test Cases for Bit Accurate Types --------------------===// + // + // This file was developed by Guoling Han and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This is used to test trunc and sext instructions. + // + //===----------------------------------------------------------------------===// + + #include <stdio.h> + + typedef int __attribute__ ((bitwidth(24))) int24; + + int + test(int24 v) + { + int y; + + y = v * (-1); + printf("test() y = %d\n", y); + + return 0; + } + + int + main ( int argc, char** argv) + { + int num; + int24 x; + + if (argc > 1) + num = atoi(argv[1]); + + test(num); + + num = num - 0xdf5e75; //0x10001 + + x = num; + + printf("x=%x\n", x); + + if(x != 1) + printf("error\n"); + + test(x); + + return 0; + } Index: llvm-test/SingleSource/UnitTests/Integer/trunc.reference_output diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/trunc.reference_output:1.1 *** /dev/null Thu Jan 25 21:10:33 2007 --- llvm-test/SingleSource/UnitTests/Integer/trunc.reference_output Thu Jan 25 21:10:17 2007 *************** *** 0 **** --- 1,4 ---- + test() y = 2138506 + x=1 + test() y = -1 + exit 0 Index: llvm-test/SingleSource/UnitTests/Integer/general-test.c diff -u llvm-test/SingleSource/UnitTests/Integer/general-test.c:1.5 llvm-test/SingleSource/UnitTests/Integer/general-test.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/general-test.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/general-test.c Thu Jan 25 21:10:17 2007 @@ -41,7 +41,7 @@ *result = sizeof(My17BitInt) + sizeof(j) + sizeof(struct MyStruct); Data1.i4Field = num; Data1.i12Field = num + 1; - Data1.i17Field = num + 2; + Data1.i17Field = num + 2; Data1.i37Field = num + 3; Data1.next = 0; Data2 = Data1; Index: llvm-test/SingleSource/UnitTests/Integer/matrix.c diff -u llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.7 llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.8 --- llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.7 Mon Jan 22 18:17:21 2007 +++ llvm-test/SingleSource/UnitTests/Integer/matrix.c Thu Jan 25 21:10:17 2007 @@ -19,10 +19,10 @@ typedef enum bool{false=0, true=1} bool; -void mysort(const int17 X[8], int17 Y[8]) +void mysort(const int24 X[8], int24 Y[8]) { unsigned int i, j; - int17 temp; + int24 temp; { j = 0; for ( ; ; ) { @@ -69,11 +69,11 @@ -int my_test(int17 A[8][8], int17 B[8][8]) +int my_test(int24 A[8][8], int24 B[8][8]) { unsigned int i, j, k, dd; - int17 C[8][8]; - int17 D[8]; + int24 C[8][8]; + int24 D[8]; int t; { i = 0; @@ -118,8 +118,8 @@ { int i, j; - int17 X[8][8]; - int17 Y[8][8]; + int24 X[8][8]; + int24 Y[8][8]; for(i=0; i<8; i++) for(j=0; j<8; j++){ Index: llvm-test/SingleSource/UnitTests/Integer/matrix.h diff -u llvm-test/SingleSource/UnitTests/Integer/matrix.h:1.1 llvm-test/SingleSource/UnitTests/Integer/matrix.h:1.2 --- llvm-test/SingleSource/UnitTests/Integer/matrix.h:1.1 Thu Jan 18 20:22:46 2007 +++ llvm-test/SingleSource/UnitTests/Integer/matrix.h Thu Jan 25 21:10:17 2007 @@ -2,5 +2,5 @@ // Date: Fri Jan 12 17:32:33 CST 2007 #ifndef DATATYPE_DEFINE #define DATATYPE_DEFINE -typedef int __attribute__ ((bitwidth(17))) int17; +typedef int __attribute__ ((bitwidth(24))) int24; #endif Index: llvm-test/SingleSource/UnitTests/Integer/matrix.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/matrix.reference_output:1.2 llvm-test/SingleSource/UnitTests/Integer/matrix.reference_output:1.3 --- llvm-test/SingleSource/UnitTests/Integer/matrix.reference_output:1.2 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/matrix.reference_output Thu Jan 25 21:10:17 2007 @@ -1,9 +1,9 @@ -get_gcd(50088, 48396) = 12 -get_gcd(-30896, -34280) = -8 -get_gcd(19192, 14116) = 4 -get_gcd(62512, 55744) = 16 -get_gcd(60148, -11704) = -44 -get_gcd(38384, 28232) = 8 -get_gcd(64784, 52940) = 4 -get_gcd(57344, 43808) = 32 +get_gcd(443304, 441612) = 1692 +get_gcd(886608, 883224) = 3384 +get_gcd(1329912, 1324836) = 5076 +get_gcd(1773216, 1766448) = 6768 +get_gcd(2216520, 2208060) = 8460 +get_gcd(2659824, 2649672) = 10152 +get_gcd(3103128, 3091284) = 11844 +get_gcd(3546432, 3532896) = 13536 exit 0 _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits