'Test creating a LLVM bitcode file using pycc.'

def test_pycc_bitcode(self):

    modulename = os.path.join(base_path, 'compile_with_pycc')
    bitcode_modulename = os.path.join(self.tmpdir, 'test_bitcode_legacy.bc')
    if os.path.exists(bitcode_modulename):
        os.unlink(bitcode_modulename)
    main(args=['--debug', '--llvm', '-o', bitcode_modulename, (modulename + '.py')])
    with open(bitcode_modulename, 'rb') as f:
        bc = f.read()
    bitcode_wrapper_magic = '\xde\xc0\x17\x0b'
    bitcode_magic = 'BC\xc0\xde'
    self.assertTrue(bc.startswith((bitcode_magic, bitcode_wrapper_magic)), bc)
