DataLayout { public int getAlignment(Type type) { return runTypeQuery(type, new TypeCallback<Integer>() { Integer doWithType(TargetMachine targetMachine, aura.llvm.Type type) { return (int) targetMachine.getDataLayout().getABITypeAlignment(type); } }); } DataLayout(String triple); int getAllocSize(Type type); int getAlignment(Type type); int getStoreSize(Type type);  }
@Test public void testGetAlignment() { assertEquals(4, new DataLayout("i386-unknown-linux").getAlignment(Type.I8_PTR)); assertEquals(8, new DataLayout("x86_64-unknown-linux").getAlignment(Type.I8_PTR)); assertEquals(4, new DataLayout("i386-unknown-linux").getAlignment(new StructureType(Type.I32, Type.I16, Type.I8))); assertEquals(4, new DataLayout("i386-unknown-linux").getAlignment(new StructureType(Type.I8, Type.I32))); assertEquals(8, new DataLayout("x86_64-unknown-linux").getAlignment(new StructureType(Type.I8, Type.I64))); assertEquals(8, new DataLayout("x86_64-unknown-linux").getAlignment(Type.DOUBLE)); assertEquals(4, new DataLayout("i386-unknown-linux").getAlignment(Type.I64)); assertEquals(8, new DataLayout("x86_64-unknown-linux").getAlignment(Type.I64)); }