mirror of
https://github.com/corda/corda.git
synced 2025-06-14 21:28:14 +00:00
bulk, global reformat
This commit is contained in:
@ -22,61 +22,63 @@
|
||||
|
||||
#include "test-harness.h"
|
||||
|
||||
|
||||
using namespace avian::codegen;
|
||||
using namespace vm;
|
||||
|
||||
class BasicEnv {
|
||||
public:
|
||||
public:
|
||||
System* s;
|
||||
Heap* heap;
|
||||
Architecture* arch;
|
||||
|
||||
BasicEnv():
|
||||
s(makeSystem()),
|
||||
heap(makeHeap(s, 32 * 1024)),
|
||||
arch(makeArchitectureNative(s, true))
|
||||
BasicEnv()
|
||||
: s(makeSystem()),
|
||||
heap(makeHeap(s, 32 * 1024)),
|
||||
arch(makeArchitectureNative(s, true))
|
||||
{
|
||||
arch->acquire();
|
||||
}
|
||||
|
||||
~BasicEnv() {
|
||||
~BasicEnv()
|
||||
{
|
||||
arch->release();
|
||||
s->dispose();
|
||||
}
|
||||
};
|
||||
|
||||
class Asm {
|
||||
public:
|
||||
public:
|
||||
Zone zone;
|
||||
Assembler* a;
|
||||
|
||||
Asm(BasicEnv& env):
|
||||
zone(env.s, env.heap, 8192),
|
||||
a(env.arch->makeAssembler(env.heap, &zone))
|
||||
{ }
|
||||
Asm(BasicEnv& env)
|
||||
: zone(env.s, env.heap, 8192), a(env.arch->makeAssembler(env.heap, &zone))
|
||||
{
|
||||
}
|
||||
|
||||
~Asm() {
|
||||
~Asm()
|
||||
{
|
||||
a->dispose();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
TEST(BasicAssembler) {
|
||||
TEST(BasicAssembler)
|
||||
{
|
||||
BasicEnv env;
|
||||
Asm a(env);
|
||||
}
|
||||
|
||||
TEST(ArchitecturePlan) {
|
||||
TEST(ArchitecturePlan)
|
||||
{
|
||||
BasicEnv env;
|
||||
|
||||
for(int op = (int)lir::Call; op < (int)lir::AlignedJump; op++) {
|
||||
for (int op = (int)lir::Call; op < (int)lir::AlignedJump; op++) {
|
||||
bool thunk;
|
||||
OperandMask mask;
|
||||
env.arch->plan((lir::UnaryOperation)op, vm::TargetBytesPerWord, mask, &thunk);
|
||||
env.arch->plan(
|
||||
(lir::UnaryOperation)op, vm::TargetBytesPerWord, mask, &thunk);
|
||||
assertFalse(thunk);
|
||||
assertNotEqual(static_cast<uint8_t>(0), mask.typeMask);
|
||||
assertNotEqual(static_cast<uint64_t>(0), mask.registerMask);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user