import sys
import platform
import llvm

from llvm.core import Module
from llvm.ee import EngineBuilder
from llvm.utils import check_intrinsics

m = Module.new('fjoidajfa')
eb = EngineBuilder.new(m)
target = eb.select_target()

print('target.triple=%r' % target.triple)
if sys.platform == 'darwin':
    s = {'64bit': 'x86_64', '32bit': 'x86'}[platform.architecture()[0]]
    assert target.triple.startswith(s + '-apple-darwin')

assert llvm.test(verbosity=2, run_isolated=False) == 0
#check_intrinsics.main()

print('llvm.__version__: %s' % llvm.__version__)
#assert llvm.__version__ == '0.12.0'

import sys
import platform
import llvm
from llvm.ee import TargetMachine
target = TargetMachine.new()

print('target.triple=%r' % target.triple)
if sys.platform == 'darwin':
    s = {'64bit': 'x86_64', '32bit': 'x86'}[platform.architecture()[0]]
    assert target.triple.startswith(s + '-apple-darwin')

assert llvm.test(verbosity=2, run_isolated=False) == 0
print('llvm.__version__: %s' % llvm.__version__)

Fix buildscript for Python2 on OSX
Fix buildscript for Python2 on OSX

  import sys
  import platform
  import llvm
+ from llvm.ee import TargetMachine
+ target = TargetMachine.new()
- 
- from llvm.core import Module
- from llvm.ee import EngineBuilder
- from llvm.utils import check_intrinsics
- 
- m = Module.new('fjoidajfa')
- eb = EngineBuilder.new(m)
- target = eb.select_target()
  
  print('target.triple=%r' % target.triple)
  if sys.platform == 'darwin':
      s = {'64bit': 'x86_64', '32bit': 'x86'}[platform.architecture()[0]]
      assert target.triple.startswith(s + '-apple-darwin')
  
  assert llvm.test(verbosity=2, run_isolated=False) == 0
- #check_intrinsics.main()
+ print('llvm.__version__: %s' % llvm.__version__)
  
- print('llvm.__version__: %s' % llvm.__version__)
- #assert llvm.__version__ == '0.12.0'
- 
Fix buildscript for Python2 on OSX
## Code Before:
import sys
import platform
import llvm

from llvm.core import Module
from llvm.ee import EngineBuilder
from llvm.utils import check_intrinsics

m = Module.new('fjoidajfa')
eb = EngineBuilder.new(m)
target = eb.select_target()

print('target.triple=%r' % target.triple)
if sys.platform == 'darwin':
    s = {'64bit': 'x86_64', '32bit': 'x86'}[platform.architecture()[0]]
    assert target.triple.startswith(s + '-apple-darwin')

assert llvm.test(verbosity=2, run_isolated=False) == 0
#check_intrinsics.main()

print('llvm.__version__: %s' % llvm.__version__)
#assert llvm.__version__ == '0.12.0'

## Instruction:
Fix buildscript for Python2 on OSX
## Code After:
import sys
import platform
import llvm
from llvm.ee import TargetMachine
target = TargetMachine.new()

print('target.triple=%r' % target.triple)
if sys.platform == 'darwin':
    s = {'64bit': 'x86_64', '32bit': 'x86'}[platform.architecture()[0]]
    assert target.triple.startswith(s + '-apple-darwin')

assert llvm.test(verbosity=2, run_isolated=False) == 0
print('llvm.__version__: %s' % llvm.__version__)
