[llvm-commits] [test-suite] r172716 - in /test-suite/trunk/SingleSource/UnitTests: 2003-07-10-SignConversions.c 2003-07-10-SignConversions.reference_output
Tim Northover
Tim.Northover at arm.com
Thu Jan 17 05:24:39 PST 2013
Author: tnorthover
Date: Thu Jan 17 07:24:38 2013
New Revision: 172716
URL: http://llvm.org/viewvc/llvm-project?rev=172716&view=rev
Log:
Explicitly specify "signed char" when testing extensions.
The ARM ABIs specify that char is unsigned by default, in contrast to many
others. This test seemed more concerned about the extensions that get applied
to "signed char" than whether that's the default so just add "signed" to the
types.
Modified:
test-suite/trunk/SingleSource/UnitTests/2003-07-10-SignConversions.c
test-suite/trunk/SingleSource/UnitTests/2003-07-10-SignConversions.reference_output
Modified: test-suite/trunk/SingleSource/UnitTests/2003-07-10-SignConversions.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/2003-07-10-SignConversions.c?rev=172716&r1=172715&r2=172716&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/2003-07-10-SignConversions.c (original)
+++ test-suite/trunk/SingleSource/UnitTests/2003-07-10-SignConversions.c Thu Jan 17 07:24:38 2013
@@ -6,27 +6,27 @@
unsigned char getUC() { return 0x80; }
- char getC() { return 0x80; }
+signed char getSC() { return 0x80; }
int main()
{
- char C80 = getC();
+ signed char SC80 = getSC();
unsigned char UC80 = getUC();
/* source is smaller than dest: both decide */
- unsigned short us = (unsigned short) C80; /* sign-ext then zero-ext */
+ unsigned short us = (unsigned short) SC80; /* sign-ext then zero-ext */
unsigned short us2 = (unsigned short) UC80; /* zero-ext only: NOP! */
- short s = ( short) C80; /* sign-ext */
+ short s = ( short) SC80; /* sign-ext */
short s2 = ( short) UC80; /* zero-extend only : NOP! */
- printf("%d %d --> unsigned: us = %d, us2 = %d\n", C80, UC80, us, us2);
- printf("%d %d --> signed: s = %d, s2 = %d\n", C80, UC80, s, s2);
+ printf("%d %d --> unsigned: us = %d, us2 = %d\n", SC80, UC80, us, us2);
+ printf("%d %d --> signed: s = %d, s2 = %d\n", SC80, UC80, s, s2);
/* source is same size or larger than dest: dest decides */
- unsigned char uc = (unsigned char ) C80; /* zero-ext */
+ unsigned char uc = (unsigned char ) SC80; /* zero-ext */
unsigned char uc2 = (unsigned char ) UC80; /* NOP */
- char c = ( char ) C80; /* NOP */
- char c2 = ( char ) UC80; /* sign-extend */
- printf("%d %d --> unsigned: uc = %d, uc2 = %d\n", C80, UC80, uc, uc2);
- printf("%d %d --> signed: c = %d, c2 = %d\n", C80, UC80, c, c2);
+ signed char sc = (signed char ) SC80; /* NOP */
+ signed char sc2 = (signed char ) UC80; /* sign-extend */
+ printf("%d %d --> unsigned: uc = %d, uc2 = %d\n", SC80, UC80, uc, uc2);
+ printf("%d %d --> signed: sc = %d, sc2 = %d\n", SC80, UC80, sc, sc2);
return 0;
}
Modified: test-suite/trunk/SingleSource/UnitTests/2003-07-10-SignConversions.reference_output
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/2003-07-10-SignConversions.reference_output?rev=172716&r1=172715&r2=172716&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/2003-07-10-SignConversions.reference_output (original)
+++ test-suite/trunk/SingleSource/UnitTests/2003-07-10-SignConversions.reference_output Thu Jan 17 07:24:38 2013
@@ -1,5 +1,5 @@
-128 128 --> unsigned: us = 65408, us2 = 128
-128 128 --> signed: s = -128, s2 = 128
-128 128 --> unsigned: uc = 128, uc2 = 128
--128 128 --> signed: c = -128, c2 = -128
+-128 128 --> signed: sc = -128, sc2 = -128
exit 0
More information about the llvm-commits
mailing list