Hello community, here is the log from the commit of package python3-llvmlite for openSUSE:Factory checked in at 2017-01-18 21:43:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-llvmlite (Old) and /work/SRC/openSUSE:Factory/.python3-llvmlite.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-llvmlite" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-llvmlite/python3-llvmlite.changes 2016-11-21 14:26:26.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python3-llvmlite.new/python3-llvmlite.changes 2017-01-18 21:43:10.832923659 +0100 @@ -1,0 +2,17 @@ +Tue Jan 10 17:15:23 UTC 2017 - [email protected] + +- specfile: + * update copyright year + * update line numbers and reg-exp in patch + +- update to version 0.15.0: + * Enhancements: + + PR #213: Add partial LLVM bindings for ObjectFile. + + PR #215: Add inline assembly helpers in the builder. + + PR #216: Allow specifying alignment in alloca instructions. + + PR #219: Remove unnecessary verify in module linkage. + * Fixes: + + PR #209, Issue #208: Fix overly restrictive test for library + filenames. + +------------------------------------------------------------------- Old: ---- llvmlite-0.14.0.tar.gz New: ---- llvmlite-0.15.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-llvmlite.spec ++++++ --- /var/tmp/diff_new_pack.sVFQdI/_old 2017-01-18 21:43:11.212869918 +0100 +++ /var/tmp/diff_new_pack.sVFQdI/_new 2017-01-18 21:43:11.216869352 +0100 @@ -1,7 +1,7 @@ # # spec file for package python3-llvmlite # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -13,27 +13,28 @@ # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Name: python3-llvmlite -Version: 0.14.0 +Version: 0.15.0 Release: 0 -License: BSD-2-Clause Summary: Lightweight wrapper around basic LLVM functionality -Url: http://llvmlite.pydata.org +License: BSD-2-Clause Group: Development/Languages/Python +Url: http://llvmlite.pydata.org Source: https://files.pythonhosted.org/packages/source/l/llvmlite/llvmlite-%{version}.tar.gz # PATCH-FIX-OPENSUSE disable_unittest_library_detection.patch -- Disable anaconda-specific library test Patch0: disable_unittest_library_detection.patch -BuildRequires: python3-devel -BuildRequires: python3-setuptools +BuildRequires: clang3_8-devel BuildRequires: cmake BuildRequires: glibc-devel +BuildRequires: llvm3_8-LTO-devel BuildRequires: llvm3_8-devel -BuildRequires: clang3_8-devel BuildRequires: llvm3_8-gold -BuildRequires: llvm3_8-LTO-devel BuildRequires: ncurses-devel +BuildRequires: python3-devel +BuildRequires: python3-setuptools BuildRequires: zlib-devel BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ disable_unittest_library_detection.patch ++++++ --- /var/tmp/diff_new_pack.sVFQdI/_old 2017-01-18 21:43:11.236866524 +0100 +++ /var/tmp/diff_new_pack.sVFQdI/_new 2017-01-18 21:43:11.236866524 +0100 @@ -9,7 +9,7 @@ diff -U 3 -H -d -r -N -- a/llvmlite/tests/test_binding.py b/llvmlite/tests/test_binding.py --- a/llvmlite/tests/test_binding.py +++ b/llvmlite/tests/test_binding.py -@@ -145,40 +145,40 @@ +@@ -157,40 +157,40 @@ return target.create_target_machine() @@ -32,7 +32,7 @@ - out, _ = p.communicate() - self.assertEqual(0, p.returncode) - # Parse library dependencies -- lib_pat = re.compile(r'^([-_a-zA-Z0-9]+)\.so(?:\.\d+)?$') +- lib_pat = re.compile(r'^([-_a-zA-Z0-9]+)\.so(?:\.\d+){0,3}$') - deps = set() - for line in out.decode().splitlines(): - parts = line.split() @@ -61,7 +61,7 @@ + #out, _ = p.communicate() + #self.assertEqual(0, p.returncode) + ## Parse library dependencies -+ #lib_pat = re.compile(r'^([-_a-zA-Z0-9]+)\.so(?:\.\d+)?$') ++ #lib_pat = re.compile(r'^([-_a-zA-Z0-9]+)\.so(?:\.\d+){0,3}$') + #deps = set() + #for line in out.decode().splitlines(): + #parts = line.split() ++++++ llvmlite-0.14.0.tar.gz -> llvmlite-0.15.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/llvmlite-0.14.0/PKG-INFO new/llvmlite-0.15.0/PKG-INFO --- old/llvmlite-0.14.0/PKG-INFO 2016-10-18 16:24:22.000000000 +0200 +++ new/llvmlite-0.15.0/PKG-INFO 2016-12-22 01:11:03.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: llvmlite -Version: 0.14.0 +Version: 0.15.0 Summary: lightweight wrapper around basic LLVM functionality Home-page: http://llvmlite.pydata.org Author: Continuum Analytics, Inc. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/llvmlite-0.14.0/ffi/CMakeLists.txt new/llvmlite-0.15.0/ffi/CMakeLists.txt --- old/llvmlite-0.14.0/ffi/CMakeLists.txt 2016-04-22 18:19:21.000000000 +0200 +++ new/llvmlite-0.15.0/ffi/CMakeLists.txt 2016-10-31 16:18:35.000000000 +0100 @@ -20,7 +20,7 @@ # Define our shared library add_library(llvmlite SHARED assembly.cpp bitcode.cpp core.cpp initfini.cpp module.cpp value.cpp executionengine.cpp transforms.cpp - passmanagers.cpp targets.cpp dylib.cpp linker.cpp) + passmanagers.cpp targets.cpp dylib.cpp linker.cpp object_file.cpp) # Find the libraries that correspond to the LLVM components # that we wish to use diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/llvmlite-0.14.0/ffi/Makefile.freebsd new/llvmlite-0.15.0/ffi/Makefile.freebsd --- old/llvmlite-0.14.0/ffi/Makefile.freebsd 2016-08-15 18:32:45.000000000 +0200 +++ new/llvmlite-0.15.0/ffi/Makefile.freebsd 2016-10-31 16:18:35.000000000 +0100 @@ -6,7 +6,7 @@ INCLUDE = core.h SRC = assembly.cpp bitcode.cpp core.cpp initfini.cpp module.cpp value.cpp \ executionengine.cpp transforms.cpp passmanagers.cpp targets.cpp dylib.cpp \ - linker.cpp + linker.cpp object_file.cpp OUTPUT = libllvmlite.so all: $(OUTPUT) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/llvmlite-0.14.0/ffi/Makefile.linux new/llvmlite-0.15.0/ffi/Makefile.linux --- old/llvmlite-0.14.0/ffi/Makefile.linux 2016-08-15 18:32:45.000000000 +0200 +++ new/llvmlite-0.15.0/ffi/Makefile.linux 2016-10-31 16:18:35.000000000 +0100 @@ -11,7 +11,7 @@ INCLUDE = core.h SRC = assembly.cpp bitcode.cpp core.cpp initfini.cpp module.cpp value.cpp \ executionengine.cpp transforms.cpp passmanagers.cpp targets.cpp dylib.cpp \ - linker.cpp + linker.cpp object_file.cpp OUTPUT = libllvmlite.so all: $(OUTPUT) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/llvmlite-0.14.0/ffi/Makefile.osx new/llvmlite-0.15.0/ffi/Makefile.osx --- old/llvmlite-0.14.0/ffi/Makefile.osx 2016-08-15 18:32:45.000000000 +0200 +++ new/llvmlite-0.15.0/ffi/Makefile.osx 2016-10-31 16:18:35.000000000 +0100 @@ -6,7 +6,7 @@ INCLUDE = core.h SRC = assembly.cpp bitcode.cpp core.cpp initfini.cpp module.cpp value.cpp \ executionengine.cpp transforms.cpp passmanagers.cpp targets.cpp dylib.cpp \ - linker.cpp + linker.cpp object_file.cpp OUTPUT = libllvmlite.dylib MACOSX_DEPLOYMENT_TARGET ?= 10.9 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/llvmlite-0.14.0/ffi/object_file.cpp new/llvmlite-0.15.0/ffi/object_file.cpp --- old/llvmlite-0.14.0/ffi/object_file.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/llvmlite-0.15.0/ffi/object_file.cpp 2016-10-31 16:18:35.000000000 +0100 @@ -0,0 +1,86 @@ +#include "core.h" + +#include "llvm-c/ExecutionEngine.h" +#include "llvm-c/Object.h" + +#include "llvm/Object/ObjectFile.h" + +#include <stdio.h> + +// From lib/Object/Object.cpp +namespace llvm { + inline object::section_iterator *unwrap(LLVMSectionIteratorRef SI) { + return reinterpret_cast<object::section_iterator*>(SI); + } + + inline LLVMSectionIteratorRef + wrap(const object::section_iterator *SI) { + return reinterpret_cast<LLVMSectionIteratorRef> + (const_cast<object::section_iterator*>(SI)); + } + +} // llvm + +extern "C" { + +API_EXPORT(LLVMObjectFileRef) +LLVMPY_CreateObjectFile(const char* buf, const size_t n) +{ + return LLVMCreateObjectFile(LLVMCreateMemoryBufferWithMemoryRange(buf, n, "", false)); +} + +API_EXPORT(void) +LLVMPY_DisposeObjectFile(LLVMObjectFileRef O) +{ + return LLVMDisposeObjectFile(O); +} + +API_EXPORT(LLVMSectionIteratorRef) +LLVMPY_GetSections(LLVMObjectFileRef O) +{ + return LLVMGetSections(O); +} + +API_EXPORT(void) +LLVMPY_DisposeSectionIterator(LLVMSectionIteratorRef SI) +{ + LLVMDisposeSectionIterator(SI); +} + +API_EXPORT(void) +LLVMPY_MoveToNextSection(LLVMSectionIteratorRef SI) +{ + LLVMMoveToNextSection(SI); +} + +API_EXPORT(bool) +LLVMPY_IsSectionIteratorAtEnd(LLVMObjectFileRef O, LLVMSectionIteratorRef SI) +{ + return LLVMIsSectionIteratorAtEnd(O, SI); +} + +API_EXPORT(const char*) +LLVMPY_GetSectionName(LLVMSectionIteratorRef SI) +{ + return LLVMGetSectionName(SI); +} + +API_EXPORT(const char*) +LLVMPY_GetSectionContents(LLVMSectionIteratorRef SI) +{ + return LLVMGetSectionContents(SI); +} + +API_EXPORT(uint64_t) +LLVMPY_GetSectionSize(LLVMSectionIteratorRef SI) +{ + return LLVMGetSectionSize(SI); +} + +API_EXPORT(bool) +LLVMPY_IsSectionText(LLVMSectionIteratorRef SI) +{ + return (*llvm::unwrap(SI))->isText(); +} + +} // end extern C diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/llvmlite-0.14.0/llvmlite/_version.py new/llvmlite-0.15.0/llvmlite/_version.py --- old/llvmlite-0.14.0/llvmlite/_version.py 2016-10-18 16:24:22.000000000 +0200 +++ new/llvmlite-0.15.0/llvmlite/_version.py 2016-12-22 01:11:03.000000000 +0100 @@ -4,8 +4,8 @@ # unpacked source archive. Distribution tarballs contain a pre-generated copy # of this file. -version_version = '0.14.0' -version_full = '2dad935106b4ad224d9175ccefe8e265ef6be6b8' +version_version = '0.15.0' +version_full = '99e5ce90860b0e33a09c437c8a8bc4227c125b8c' def get_versions(default={}, verbose=False): return {'version': version_version, 'full': version_full} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/llvmlite-0.14.0/llvmlite/binding/__init__.py new/llvmlite-0.15.0/llvmlite/binding/__init__.py --- old/llvmlite-0.14.0/llvmlite/binding/__init__.py 2016-09-12 16:47:23.000000000 +0200 +++ new/llvmlite-0.15.0/llvmlite/binding/__init__.py 2016-10-31 16:18:35.000000000 +0100 @@ -14,3 +14,4 @@ from .transforms import * from .value import * from .analysis import * +from .object_file import * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/llvmlite-0.14.0/llvmlite/binding/executionengine.py new/llvmlite-0.15.0/llvmlite/binding/executionengine.py --- old/llvmlite-0.14.0/llvmlite/binding/executionengine.py 2016-09-14 15:22:31.000000000 +0200 +++ new/llvmlite-0.15.0/llvmlite/binding/executionengine.py 2016-10-31 16:18:35.000000000 +0100 @@ -5,7 +5,7 @@ py_object, Structure) import warnings -from . import ffi, targets +from . import ffi, targets, object_file # Just check these weren't optimized out of the DLL. @@ -283,6 +283,7 @@ ('buf_len', c_size_t), ] + _ObjectCacheNotifyFunc = CFUNCTYPE(None, py_object, POINTER(_ObjectCacheData)) _ObjectCacheGetBufferFunc = CFUNCTYPE(None, py_object, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/llvmlite-0.14.0/llvmlite/binding/ffi.py new/llvmlite-0.15.0/llvmlite/binding/ffi.py --- old/llvmlite-0.14.0/llvmlite/binding/ffi.py 2016-04-22 18:19:21.000000000 +0200 +++ new/llvmlite-0.15.0/llvmlite/binding/ffi.py 2016-10-31 16:18:35.000000000 +0100 @@ -26,6 +26,8 @@ LLVMGlobalsIterator = _make_opaque_ref("LLVMGlobalsIterator") LLVMFunctionsIterator = _make_opaque_ref("LLVMFunctionsIterator") LLVMObjectCacheRef = _make_opaque_ref("LLVMObjectCache") +LLVMObjectFileRef = _make_opaque_ref("LLVMObjectFile") +LLVMSectionIteratorRef = _make_opaque_ref("LLVMSectionIterator") _lib_dir = os.path.dirname(__file__) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/llvmlite-0.14.0/llvmlite/binding/linker.py new/llvmlite-0.15.0/llvmlite/binding/linker.py --- old/llvmlite-0.14.0/llvmlite/binding/linker.py 2016-08-15 18:32:45.000000000 +0200 +++ new/llvmlite-0.15.0/llvmlite/binding/linker.py 2016-12-01 09:08:38.000000000 +0100 @@ -4,8 +4,6 @@ def link_modules(dst, src): - dst.verify() - src.verify() with ffi.OutputString() as outerr: err = ffi.lib.LLVMPY_LinkModules(dst, src, outerr) # The underlying module was destroyed diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/llvmlite-0.14.0/llvmlite/binding/object_file.py new/llvmlite-0.15.0/llvmlite/binding/object_file.py --- old/llvmlite-0.14.0/llvmlite/binding/object_file.py 1970-01-01 01:00:00.000000000 +0100 +++ new/llvmlite-0.15.0/llvmlite/binding/object_file.py 2016-10-31 16:18:35.000000000 +0100 @@ -0,0 +1,59 @@ +from . import ffi +from ctypes import c_bool, c_char_p, c_size_t, c_ulonglong, string_at, c_uint64 + +class SectionIteratorRef(ffi.ObjectRef): + def name(self): + return ffi.lib.LLVMPY_GetSectionName(self) + def is_text(self): + return ffi.lib.LLVMPY_IsSectionText(self) + def size(self): + return ffi.lib.LLVMPY_GetSectionSize(self) + def data(self): + return string_at(ffi.lib.LLVMPY_GetSectionContents(self), self.size()) + def is_end(self, object_file): + return ffi.lib.LLVMPY_IsSectionIteratorAtEnd(object_file, self) + def next(self): + ffi.lib.LLVMPY_MoveToNextSection(self) + def _dispose(self): + ffi.lib.LLVMPY_DisposeSectionIterator(self) + +class ObjectFileRef(ffi.ObjectRef): + @classmethod + def from_data(cls, data): + return cls(ffi.lib.LLVMPY_CreateObjectFile(data, len(data))) + + def sections(self): + it = SectionIteratorRef(ffi.lib.LLVMPY_GetSections(self)) + while not it.is_end(self): + yield it + it.next() + + def _dispose(self): + ffi.lib.LLVMPY_DisposeObjectFile(self) + +ffi.lib.LLVMPY_CreateObjectFile.argtypes = [c_char_p, c_size_t] +ffi.lib.LLVMPY_CreateObjectFile.restype = ffi.LLVMObjectFileRef + +ffi.lib.LLVMPY_DisposeObjectFile.argtypes = [ffi.LLVMObjectFileRef] + +ffi.lib.LLVMPY_GetSections.argtypes = [ffi.LLVMObjectFileRef] +ffi.lib.LLVMPY_GetSections.restype = ffi.LLVMSectionIteratorRef + +ffi.lib.LLVMPY_DisposeSectionIterator.argtypes = [ffi.LLVMSectionIteratorRef] + +ffi.lib.LLVMPY_MoveToNextSection.argtypes = [ffi.LLVMSectionIteratorRef] + +ffi.lib.LLVMPY_IsSectionIteratorAtEnd.argtypes = [ffi.LLVMObjectFileRef, ffi.LLVMSectionIteratorRef] +ffi.lib.LLVMPY_IsSectionIteratorAtEnd.restype = c_bool + +ffi.lib.LLVMPY_GetSectionName.argtypes = [ffi.LLVMSectionIteratorRef] +ffi.lib.LLVMPY_GetSectionName.restype = c_char_p + +ffi.lib.LLVMPY_GetSectionSize.argtypes = [ffi.LLVMSectionIteratorRef] +ffi.lib.LLVMPY_GetSectionSize.restype = c_uint64 + +ffi.lib.LLVMPY_GetSectionContents.argtypes = [ffi.LLVMSectionIteratorRef] +ffi.lib.LLVMPY_GetSectionContents.restype = c_char_p + +ffi.lib.LLVMPY_IsSectionText.argtypes = [ffi.LLVMSectionIteratorRef] +ffi.lib.LLVMPY_IsSectionText.restype = c_bool diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/llvmlite-0.14.0/llvmlite/ir/builder.py new/llvmlite-0.15.0/llvmlite/ir/builder.py --- old/llvmlite-0.14.0/llvmlite/ir/builder.py 2016-09-29 18:28:38.000000000 +0200 +++ new/llvmlite-0.15.0/llvmlite/ir/builder.py 2016-12-20 19:48:55.000000000 +0100 @@ -729,6 +729,29 @@ self._insert(inst) return inst + def asm(self, ftype, asm, constraint, args, side_effect, name=''): + """ + Inline assembler. + """ + asm = instructions.InlineAsm(ftype, asm, constraint, side_effect) + return self.call(asm, args, name) + + def load_reg(self, reg_type, reg_name, name=''): + """ + Load a register value into an LLVM value. + Example: v = load_reg(IntType(32), "eax") + """ + ftype = types.FunctionType(reg_type, []) + return self.asm(ftype, "", "={%s}" % reg_name, [], False, name) + + def store_reg(self, value, reg_type, reg_name, name=''): + """ + Store an LLVM value inside a register + Example: store_reg(Constant(IntType(32), 0xAAAAAAAA), IntType(32), "eax") + """ + ftype = types.FunctionType(types.VoidType(), [reg_type]) + return self.asm(ftype, "", "{%s}" % reg_name, [value], True, name) + def invoke(self, fn, args, normal_to, unwind_to, name='', cconv=None, tail=False): inst = instructions.InvokeInstr(self.block, fn, args, normal_to, unwind_to, name=name, cconv=cconv) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/llvmlite-0.14.0/llvmlite/ir/instructions.py new/llvmlite-0.15.0/llvmlite/ir/instructions.py --- old/llvmlite-0.14.0/llvmlite/ir/instructions.py 2016-09-29 18:28:38.000000000 +0200 +++ new/llvmlite-0.15.0/llvmlite/ir/instructions.py 2016-12-20 19:48:55.000000000 +0100 @@ -123,7 +123,6 @@ def descr(self, buf): self._descr(buf, add_metadata=True) - class InvokeInstr(CallInstr): def __init__(self, parent, func, args, normal_to, unwind_to, name='', cconv=None): assert isinstance(normal_to, Block) @@ -413,12 +412,15 @@ operands = [count] if count else () super(AllocaInstr, self).__init__(parent, typ.as_pointer(), "alloca", operands, name) + self.align = None def descr(self, buf): buf.append("{0} {1}".format(self.opname, self.type.pointee)) if self.operands: op, = self.operands buf.append(", {0} {1}".format(op.type, op.get_reference())) + if self.align is not None: + buf.append(", align {0}".format(self.align)) if self.metadata: buf.append(self._stringify_metadata(leading_comma=True)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/llvmlite-0.14.0/llvmlite/tests/test_binding.py new/llvmlite-0.15.0/llvmlite/tests/test_binding.py --- old/llvmlite-0.14.0/llvmlite/tests/test_binding.py 2016-10-17 16:12:33.000000000 +0200 +++ new/llvmlite-0.15.0/llvmlite/tests/test_binding.py 2016-10-31 16:18:35.000000000 +0100 @@ -172,7 +172,7 @@ out, _ = p.communicate() self.assertEqual(0, p.returncode) # Parse library dependencies - lib_pat = re.compile(r'^([-_a-zA-Z0-9]+)\.so(?:\.\d+)?$') + lib_pat = re.compile(r'^([-_a-zA-Z0-9]+)\.so(?:\.\d+){0,3}$') deps = set() for line in out.decode().splitlines(): parts = line.split() @@ -1105,6 +1105,22 @@ asm = tm.emit_assembly(m) self.assertIn('nop', asm) +class TestObjectFile(BaseTest): + def test_object_file(self): + target_machine = self.target_machine() + mod = self.module() + obj_bin = target_machine.emit_object(mod) + obj = llvm.ObjectFileRef.from_data(obj_bin) + # Check that we have a text section, and that she has a name and data + has_text = False + for s in obj.sections(): + if s.is_text(): + has_text = True + self.assertIsNotNone(s.name()) + self.assertTrue(s.size() > 0) + self.assertTrue(len(s.data()) > 0) + break + self.assertTrue(has_text) if __name__ == "__main__": unittest.main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/llvmlite-0.14.0/llvmlite/tests/test_ir.py new/llvmlite-0.15.0/llvmlite/tests/test_ir.py --- old/llvmlite-0.14.0/llvmlite/tests/test_ir.py 2016-09-14 15:22:31.000000000 +0200 +++ new/llvmlite-0.15.0/llvmlite/tests/test_ir.py 2016-12-20 19:48:55.000000000 +0100 @@ -357,6 +357,38 @@ self.assertInText(pat, str(mod)) self.assert_valid_ir(mod) + def test_builder_asm(self): + mod = self.module() + foo = ir.Function(mod, ir.FunctionType(ir.VoidType(), []), 'foo') + builder = ir.IRBuilder(foo.append_basic_block('')) + asmty = ir.FunctionType(int32, [int32]) + builder.asm(asmty, "mov $1, $2", "=r,r", [int32(123)], side_effect=True) + builder.ret_void() + pat = 'call i32 asm sideeffect "mov $1, $2", "=r,r" ( i32 123 )' + self.assertInText(pat, str(mod)) + self.assert_valid_ir(mod) + + def test_builder_load_reg(self): + mod = self.module() + foo = ir.Function(mod, ir.FunctionType(ir.VoidType(), []), 'foo') + builder = ir.IRBuilder(foo.append_basic_block('')) + asmty = ir.FunctionType(int32, [int32]) + builder.load_reg(ir.IntType(64), "rax") + builder.ret_void() + pat = 'call i64 asm "", "={rax}"' + self.assertInText(pat, str(mod)) + self.assert_valid_ir(mod) + + def test_builder_store_reg(self): + mod = self.module() + foo = ir.Function(mod, ir.FunctionType(ir.VoidType(), []), 'foo') + builder = ir.IRBuilder(foo.append_basic_block('')) + asmty = ir.FunctionType(ir.VoidType(), [int32]) + builder.store_reg(int64(123), ir.IntType(64), "rax") + builder.ret_void() + pat = 'call void asm sideeffect "", "{rax}" ( i64 123 )' + self.assertInText(pat, str(mod)) + self.assert_valid_ir(mod) class TestGlobalValues(TestBase): @@ -691,6 +723,7 @@ c = builder.alloca(int32, name='c') d = builder.alloca(int32, size=42, name='d') e = builder.alloca(dbl, size=a, name='e') + e.align = 8 self.assertEqual(e.type, ir.PointerType(dbl)) ee = builder.store(z, e) self.assertEqual(ee.type, ir.VoidType()) @@ -717,7 +750,7 @@ my_block: %"c" = alloca i32 %"d" = alloca i32, i32 42 - %"e" = alloca double, i32 %".1" + %"e" = alloca double, i32 %".1", align 8 store double %".3", double* %"e" store i32 %".2", i32* %"c" %"g" = load i32, i32* %"c"
