mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
add arm tests (#16563)
This commit is contained in:
parent
05c898069e
commit
0da0c4b24e
1 changed files with 63 additions and 0 deletions
63
compiler/test/runnable/arm.d
Normal file
63
compiler/test/runnable/arm.d
Normal file
|
@ -0,0 +1,63 @@
|
|||
|
||||
/**************************************
|
||||
* Tests aimed at the Arm code generator, even though they also
|
||||
* need to pass the x86 compiler.
|
||||
*/
|
||||
|
||||
import core.stdc.stdio;
|
||||
|
||||
/******************************************************/
|
||||
|
||||
pragma(inline, false)
|
||||
{
|
||||
ulong movregconst64_0() { return 0x123456789abcdef0; }
|
||||
ulong movregconst64_1() { return 0x12345678; }
|
||||
ulong movregconst64_2() { return 0xFFFF5678; }
|
||||
ulong movregconst64_3() { return 0x1234FFFF; }
|
||||
ulong movregconst64_4() { return 0xFFFF_FFFF_FFFF_1234; }
|
||||
ulong movregconst64_5() { return 0xFFFF_FFFF_1234_FFFF; }
|
||||
ulong movregconst64_6() { return 0xFFFF_1234_FFFF_FFFF; }
|
||||
ulong movregconst64_7() { return 0x1234_FFFF_FFFF_FFFF; }
|
||||
ulong movregconst64_8() { return 0x5555_5555_5555_5555; }
|
||||
ulong movregconst64_9() { return 0xAAAA_AAAA_AAAA_AAAA; }
|
||||
ulong movregconst64_10() { return 0xFFFF_FFFF_FFFF_FFFE; }
|
||||
|
||||
uint movregconst32_0() { return 0x12345678; }
|
||||
uint movregconst32_1() { return 0xFFFF5678; }
|
||||
uint movregconst32_2() { return 0x1234FFFF; }
|
||||
uint movregconst32_3() { return 0x55555555; }
|
||||
uint movregconst32_4() { return 0xAAAAAAAA; }
|
||||
uint movregconst32_5() { return 0xFFFFFFFF; }
|
||||
}
|
||||
|
||||
void testmovregconst()
|
||||
{
|
||||
assert(movregconst64_0() == 0x123456789abcdef0);
|
||||
assert(movregconst64_1() == 0x12345678);
|
||||
assert(movregconst64_2() == 0xFFFF5678);
|
||||
assert(movregconst64_3() == 0x1234FFFF);
|
||||
assert(movregconst64_4() == 0xFFFF_FFFF_FFFF_1234);
|
||||
assert(movregconst64_5() == 0xFFFF_FFFF_1234_FFFF);
|
||||
assert(movregconst64_6() == 0xFFFF_1234_FFFF_FFFF);
|
||||
assert(movregconst64_7() == 0x1234_FFFF_FFFF_FFFF);
|
||||
assert(movregconst64_8() == 0x5555_5555_5555_5555);
|
||||
assert(movregconst64_9() == 0xAAAA_AAAA_AAAA_AAAA);
|
||||
assert(movregconst64_10() == 0xFFFF_FFFF_FFFF_FFFE);
|
||||
|
||||
assert(movregconst32_0() == 0x12345678);
|
||||
assert(movregconst32_1() == 0xFFFF5678);
|
||||
assert(movregconst32_2() == 0x1234FFFF);
|
||||
assert(movregconst32_3() == 0x55555555);
|
||||
assert(movregconst32_4() == 0xAAAAAAAA);
|
||||
assert(movregconst32_5() == 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
/******************************************************/
|
||||
|
||||
int main()
|
||||
{
|
||||
testmovregconst();
|
||||
|
||||
printf("Success\n");
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue