llvmlite 0.43.0rc1__cp311-cp311-macosx_11_0_arm64.whl → 0.44.0rc2__cp311-cp311-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of llvmlite might be problematic. Click here for more details.
- llvmlite/__init__.py +7 -0
- llvmlite/_version.py +2 -2
- llvmlite/binding/__init__.py +1 -0
- llvmlite/binding/context.py +12 -2
- llvmlite/binding/ffi.py +6 -1
- llvmlite/binding/libllvmlite.dylib +0 -0
- llvmlite/binding/newpassmanagers.py +357 -0
- llvmlite/binding/passmanagers.py +25 -18
- llvmlite/binding/targets.py +75 -5
- llvmlite/binding/typeref.py +88 -1
- llvmlite/binding/value.py +14 -0
- llvmlite/ir/builder.py +8 -7
- llvmlite/ir/context.py +2 -2
- llvmlite/ir/instructions.py +52 -25
- llvmlite/ir/types.py +137 -17
- llvmlite/ir/values.py +2 -2
- llvmlite/tests/test_binding.py +663 -40
- llvmlite/tests/test_ir.py +411 -146
- llvmlite/tests/test_refprune.py +179 -6
- {llvmlite-0.43.0rc1.dist-info → llvmlite-0.44.0rc2.dist-info}/METADATA +7 -6
- llvmlite-0.44.0rc2.dist-info/RECORD +46 -0
- {llvmlite-0.43.0rc1.dist-info → llvmlite-0.44.0rc2.dist-info}/WHEEL +1 -1
- llvmlite-0.43.0rc1.dist-info/RECORD +0 -45
- {llvmlite-0.43.0rc1.dist-info → llvmlite-0.44.0rc2.dist-info}/LICENSE +0 -0
- {llvmlite-0.43.0rc1.dist-info → llvmlite-0.44.0rc2.dist-info}/LICENSE.thirdparty +0 -0
- {llvmlite-0.43.0rc1.dist-info → llvmlite-0.44.0rc2.dist-info}/top_level.txt +0 -0
llvmlite/tests/test_ir.py
CHANGED
|
@@ -13,6 +13,9 @@ from . import TestCase
|
|
|
13
13
|
from llvmlite import ir
|
|
14
14
|
from llvmlite import binding as llvm
|
|
15
15
|
|
|
16
|
+
# FIXME: Remove me once typed pointers are no longer supported.
|
|
17
|
+
from llvmlite import opaque_pointers_enabled
|
|
18
|
+
|
|
16
19
|
|
|
17
20
|
int1 = ir.IntType(1)
|
|
18
21
|
int8 = ir.IntType(8)
|
|
@@ -120,7 +123,11 @@ class TestBase(TestCase):
|
|
|
120
123
|
|
|
121
124
|
class TestFunction(TestBase):
|
|
122
125
|
|
|
123
|
-
|
|
126
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
127
|
+
proto = \
|
|
128
|
+
"""i32 @"my_func"(i32 %".1", i32 %".2", double %".3", ptr %".4")""" \
|
|
129
|
+
if opaque_pointers_enabled else \
|
|
130
|
+
"""i32 @"my_func"(i32 %".1", i32 %".2", double %".3", i32* %".4")"""
|
|
124
131
|
|
|
125
132
|
def test_declare(self):
|
|
126
133
|
# A simple declaration
|
|
@@ -139,11 +146,19 @@ class TestFunction(TestBase):
|
|
|
139
146
|
pers = ir.Function(self.module(), tp_pers, '__gxx_personality_v0')
|
|
140
147
|
func.attributes.personality = pers
|
|
141
148
|
asm = self.descr(func).strip()
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
149
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
150
|
+
if opaque_pointers_enabled:
|
|
151
|
+
self.assertEqual(asm,
|
|
152
|
+
("declare %s alwaysinline convergent optsize "
|
|
153
|
+
"alignstack(16) "
|
|
154
|
+
"personality ptr @\"__gxx_personality_v0\"") %
|
|
155
|
+
self.proto)
|
|
156
|
+
else:
|
|
157
|
+
self.assertEqual(asm,
|
|
158
|
+
("declare %s alwaysinline convergent optsize "
|
|
159
|
+
"alignstack(16) personality "
|
|
160
|
+
"i8 (...)* @\"__gxx_personality_v0\"") %
|
|
161
|
+
self.proto)
|
|
147
162
|
# Check pickling
|
|
148
163
|
self.assert_pickle_correctly(func)
|
|
149
164
|
|
|
@@ -157,9 +172,15 @@ class TestFunction(TestBase):
|
|
|
157
172
|
func.args[3].add_attribute("nonnull")
|
|
158
173
|
func.return_value.add_attribute("noalias")
|
|
159
174
|
asm = self.descr(func).strip()
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
175
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
176
|
+
if opaque_pointers_enabled:
|
|
177
|
+
self.assertEqual(asm,
|
|
178
|
+
"""declare noalias i32 @"my_func"(i32 zeroext %".1", i32 dereferenceable(5) dereferenceable_or_null(10) %".2", double %".3", ptr nonnull align 4 %".4")""" # noqa E501
|
|
179
|
+
)
|
|
180
|
+
else:
|
|
181
|
+
self.assertEqual(asm,
|
|
182
|
+
"""declare noalias i32 @"my_func"(i32 zeroext %".1", i32 dereferenceable(5) dereferenceable_or_null(10) %".2", double %".3", i32* nonnull align 4 %".4")""" # noqa E501
|
|
183
|
+
)
|
|
163
184
|
# Check pickling
|
|
164
185
|
self.assert_pickle_correctly(func)
|
|
165
186
|
|
|
@@ -263,10 +284,17 @@ class TestFunction(TestBase):
|
|
|
263
284
|
assume = module.declare_intrinsic('llvm.assume')
|
|
264
285
|
self.check_descr(self.descr(powi).strip(), """\
|
|
265
286
|
declare double @"llvm.powi.f64"(double %".1", i32 %".2")""")
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
287
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
288
|
+
if opaque_pointers_enabled:
|
|
289
|
+
self.check_descr(self.descr(memset).strip(), """\
|
|
290
|
+
declare void @"llvm.memset.p0i8.i32"(ptr %".1", i8 %".2", i32 %".3", i1 %".4")""") # noqa E501
|
|
291
|
+
self.check_descr(self.descr(memcpy).strip(), """\
|
|
292
|
+
declare void @"llvm.memcpy.p0i8.p0i8.i32"(ptr %".1", ptr %".2", i32 %".3", i1 %".4")""") # noqa E501
|
|
293
|
+
else:
|
|
294
|
+
self.check_descr(self.descr(memset).strip(), """\
|
|
295
|
+
declare void @"llvm.memset.p0i8.i32"(i8* %".1", i8 %".2", i32 %".3", i1 %".4")""") # noqa E501
|
|
296
|
+
self.check_descr(self.descr(memcpy).strip(), """\
|
|
297
|
+
declare void @"llvm.memcpy.p0i8.p0i8.i32"(i8* %".1", i8* %".2", i32 %".3", i1 %".4")""") # noqa E501
|
|
270
298
|
self.check_descr(self.descr(assume).strip(), """\
|
|
271
299
|
declare void @"llvm.assume"(i1 %".1")""")
|
|
272
300
|
|
|
@@ -374,7 +402,11 @@ class TestIR(TestBase):
|
|
|
374
402
|
# A null metadata (typed) value
|
|
375
403
|
mod = self.module()
|
|
376
404
|
mod.add_metadata([int32.as_pointer()(None)])
|
|
377
|
-
|
|
405
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
406
|
+
if opaque_pointers_enabled:
|
|
407
|
+
self.assert_ir_line("!0 = !{ ptr null }", mod)
|
|
408
|
+
else:
|
|
409
|
+
self.assert_ir_line("!0 = !{ i32* null }", mod)
|
|
378
410
|
self.assert_valid_ir(mod)
|
|
379
411
|
# A null metadata (untyped) value
|
|
380
412
|
mod = self.module()
|
|
@@ -591,8 +623,14 @@ class TestGlobalValues(TestBase):
|
|
|
591
623
|
with self.assertRaises(KeyError):
|
|
592
624
|
mod.get_global('kkk')
|
|
593
625
|
# Globals should have a useful repr()
|
|
594
|
-
|
|
595
|
-
|
|
626
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
627
|
+
if opaque_pointers_enabled:
|
|
628
|
+
self.assertEqual(repr(globdouble),
|
|
629
|
+
"<ir.GlobalVariable 'globdouble' of type 'ptr'>")
|
|
630
|
+
else:
|
|
631
|
+
self.assertEqual(
|
|
632
|
+
repr(globdouble),
|
|
633
|
+
"<ir.GlobalVariable 'globdouble' of type 'double*'>")
|
|
596
634
|
|
|
597
635
|
def test_functions_global_values_access(self):
|
|
598
636
|
"""
|
|
@@ -989,6 +1027,11 @@ my_block:
|
|
|
989
1027
|
self.assertEqual(j.type, ir.VoidType())
|
|
990
1028
|
k = builder.load_atomic(c, ordering="seq_cst", align=4, name='k')
|
|
991
1029
|
self.assertEqual(k.type, int32)
|
|
1030
|
+
if opaque_pointers_enabled:
|
|
1031
|
+
ptr = ir.Constant(ir.PointerType(), None)
|
|
1032
|
+
else:
|
|
1033
|
+
ptr = ir.Constant(ir.PointerType(int32), None)
|
|
1034
|
+
builder.store(ir.Constant(int32, 5), ptr)
|
|
992
1035
|
# Not pointer types
|
|
993
1036
|
with self.assertRaises(TypeError):
|
|
994
1037
|
builder.store(b, a)
|
|
@@ -997,21 +1040,42 @@ my_block:
|
|
|
997
1040
|
# Mismatching pointer type
|
|
998
1041
|
with self.assertRaises(TypeError) as cm:
|
|
999
1042
|
builder.store(b, e)
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1043
|
+
|
|
1044
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
1045
|
+
if opaque_pointers_enabled:
|
|
1046
|
+
self.assertEqual(str(cm.exception),
|
|
1047
|
+
"cannot store i32 to ptr: mismatching types")
|
|
1048
|
+
self.check_block(block, """\
|
|
1049
|
+
my_block:
|
|
1050
|
+
%"c" = alloca i32
|
|
1051
|
+
%"d" = alloca i32, i32 42
|
|
1052
|
+
%"e" = alloca double, i32 %".1", align 8
|
|
1053
|
+
store double %".3", ptr %"e"
|
|
1054
|
+
store i32 %".2", ptr %"c"
|
|
1055
|
+
%"g" = load i32, ptr %"c"
|
|
1056
|
+
store i32 %".2", ptr %"c", align 1
|
|
1057
|
+
%"i" = load i32, ptr %"c", align 1
|
|
1058
|
+
store atomic i32 %".2", ptr %"c" seq_cst, align 4
|
|
1059
|
+
%"k" = load atomic i32, ptr %"c" seq_cst, align 4
|
|
1060
|
+
store i32 5, ptr null
|
|
1061
|
+
""")
|
|
1062
|
+
else:
|
|
1063
|
+
self.assertEqual(str(cm.exception),
|
|
1064
|
+
"cannot store i32 to double*: mismatching types")
|
|
1065
|
+
self.check_block(block, """\
|
|
1066
|
+
my_block:
|
|
1067
|
+
%"c" = alloca i32
|
|
1068
|
+
%"d" = alloca i32, i32 42
|
|
1069
|
+
%"e" = alloca double, i32 %".1", align 8
|
|
1070
|
+
store double %".3", double* %"e"
|
|
1071
|
+
store i32 %".2", i32* %"c"
|
|
1072
|
+
%"g" = load i32, i32* %"c"
|
|
1073
|
+
store i32 %".2", i32* %"c", align 1
|
|
1074
|
+
%"i" = load i32, i32* %"c", align 1
|
|
1075
|
+
store atomic i32 %".2", i32* %"c" seq_cst, align 4
|
|
1076
|
+
%"k" = load atomic i32, i32* %"c" seq_cst, align 4
|
|
1077
|
+
store i32 5, i32* null
|
|
1078
|
+
""")
|
|
1015
1079
|
|
|
1016
1080
|
def test_gep(self):
|
|
1017
1081
|
block = self.block(name='my_block')
|
|
@@ -1020,11 +1084,19 @@ my_block:
|
|
|
1020
1084
|
c = builder.alloca(ir.PointerType(int32), name='c')
|
|
1021
1085
|
d = builder.gep(c, [ir.Constant(int32, 5), a], name='d')
|
|
1022
1086
|
self.assertEqual(d.type, ir.PointerType(int32))
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1087
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
1088
|
+
if opaque_pointers_enabled:
|
|
1089
|
+
self.check_block(block, """\
|
|
1090
|
+
my_block:
|
|
1091
|
+
%"c" = alloca ptr
|
|
1092
|
+
%"d" = getelementptr ptr, ptr %"c", i32 5, i32 %".1"
|
|
1093
|
+
""")
|
|
1094
|
+
else:
|
|
1095
|
+
self.check_block(block, """\
|
|
1096
|
+
my_block:
|
|
1097
|
+
%"c" = alloca i32*
|
|
1098
|
+
%"d" = getelementptr i32*, i32** %"c", i32 5, i32 %".1"
|
|
1099
|
+
""")
|
|
1028
1100
|
# XXX test with more complex types
|
|
1029
1101
|
|
|
1030
1102
|
def test_gep_castinstr(self):
|
|
@@ -1038,11 +1110,19 @@ my_block:
|
|
|
1038
1110
|
d = builder.bitcast(a, ls.as_pointer(), name='d')
|
|
1039
1111
|
e = builder.gep(d, [ir.Constant(int32, x) for x in [0, 3]], name='e')
|
|
1040
1112
|
self.assertEqual(e.type, ir.PointerType(int8ptr))
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1113
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
1114
|
+
if opaque_pointers_enabled:
|
|
1115
|
+
self.check_block(block, """\
|
|
1116
|
+
my_block:
|
|
1117
|
+
%"d" = bitcast i32 %".1" to ptr
|
|
1118
|
+
%"e" = getelementptr {i64, ptr, ptr, ptr, i64}, ptr %"d", i32 0, i32 3
|
|
1119
|
+
""") # noqa E501
|
|
1120
|
+
else:
|
|
1121
|
+
self.check_block(block, """\
|
|
1122
|
+
my_block:
|
|
1123
|
+
%"d" = bitcast i32 %".1" to {i64, i8*, i8*, i8*, i64}*
|
|
1124
|
+
%"e" = getelementptr {i64, i8*, i8*, i8*, i64}, {i64, i8*, i8*, i8*, i64}* %"d", i32 0, i32 3
|
|
1125
|
+
""") # noqa E501
|
|
1046
1126
|
|
|
1047
1127
|
def test_gep_castinstr_addrspace(self):
|
|
1048
1128
|
# similar to:
|
|
@@ -1057,11 +1137,19 @@ my_block:
|
|
|
1057
1137
|
e = builder.gep(d, [ir.Constant(int32, x) for x in [0, 3]], name='e')
|
|
1058
1138
|
self.assertEqual(e.type.addrspace, addrspace)
|
|
1059
1139
|
self.assertEqual(e.type, ir.PointerType(int8ptr, addrspace=addrspace))
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1140
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
1141
|
+
if opaque_pointers_enabled:
|
|
1142
|
+
self.check_block(block, """\
|
|
1143
|
+
my_block:
|
|
1144
|
+
%"d" = bitcast i32 %".1" to ptr addrspace(4)
|
|
1145
|
+
%"e" = getelementptr {i64, ptr, ptr, ptr, i64}, ptr addrspace(4) %"d", i32 0, i32 3
|
|
1146
|
+
""") # noqa E501
|
|
1147
|
+
else:
|
|
1148
|
+
self.check_block(block, """\
|
|
1149
|
+
my_block:
|
|
1150
|
+
%"d" = bitcast i32 %".1" to {i64, i8*, i8*, i8*, i64} addrspace(4)*
|
|
1151
|
+
%"e" = getelementptr {i64, i8*, i8*, i8*, i64}, {i64, i8*, i8*, i8*, i64} addrspace(4)* %"d", i32 0, i32 3
|
|
1152
|
+
""") # noqa E501
|
|
1065
1153
|
|
|
1066
1154
|
def test_gep_addrspace(self):
|
|
1067
1155
|
block = self.block(name='my_block')
|
|
@@ -1069,18 +1157,31 @@ my_block:
|
|
|
1069
1157
|
a, b = builder.function.args[:2]
|
|
1070
1158
|
addrspace = 4
|
|
1071
1159
|
c = builder.alloca(ir.PointerType(int32, addrspace=addrspace), name='c')
|
|
1072
|
-
|
|
1160
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
1161
|
+
if opaque_pointers_enabled:
|
|
1162
|
+
self.assertEqual(str(c.type), 'ptr')
|
|
1163
|
+
else:
|
|
1164
|
+
self.assertEqual(str(c.type), 'i32 addrspace(4)**')
|
|
1073
1165
|
self.assertEqual(c.type.pointee.addrspace, addrspace)
|
|
1074
1166
|
d = builder.gep(c, [ir.Constant(int32, 5), a], name='d')
|
|
1075
1167
|
self.assertEqual(d.type.addrspace, addrspace)
|
|
1076
1168
|
e = builder.gep(d, [ir.Constant(int32, 10)], name='e')
|
|
1077
1169
|
self.assertEqual(e.type.addrspace, addrspace)
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1170
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
1171
|
+
if opaque_pointers_enabled:
|
|
1172
|
+
self.check_block(block, """\
|
|
1173
|
+
my_block:
|
|
1174
|
+
%"c" = alloca ptr addrspace(4)
|
|
1175
|
+
%"d" = getelementptr ptr addrspace(4), ptr %"c", i32 5, i32 %".1"
|
|
1176
|
+
%"e" = getelementptr i32, ptr addrspace(4) %"d", i32 10
|
|
1177
|
+
""") # noqa E501
|
|
1178
|
+
else:
|
|
1179
|
+
self.check_block(block, """\
|
|
1180
|
+
my_block:
|
|
1181
|
+
%"c" = alloca i32 addrspace(4)*
|
|
1182
|
+
%"d" = getelementptr i32 addrspace(4)*, i32 addrspace(4)** %"c", i32 5, i32 %".1"
|
|
1183
|
+
%"e" = getelementptr i32, i32 addrspace(4)* %"d", i32 10
|
|
1184
|
+
""") # noqa E501
|
|
1084
1185
|
|
|
1085
1186
|
def test_extract_insert_value(self):
|
|
1086
1187
|
block = self.block(name='my_block')
|
|
@@ -1128,20 +1229,37 @@ my_block:
|
|
|
1128
1229
|
# Replacement value has the wrong type
|
|
1129
1230
|
builder.insert_value(c_inner, a, 1)
|
|
1130
1231
|
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1232
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
1233
|
+
if opaque_pointers_enabled:
|
|
1234
|
+
self.check_block(block, """\
|
|
1235
|
+
my_block:
|
|
1236
|
+
%"c" = extractvalue {i32, i1} {i32 4, i1 true}, 0
|
|
1237
|
+
%"d" = insertvalue {i32, i1} {i32 4, i1 true}, i32 %".1", 0
|
|
1238
|
+
%"e" = insertvalue {i32, i1} %"d", i1 false, 1
|
|
1239
|
+
%"ptr" = alloca {i8, {i32, i1}}
|
|
1240
|
+
%"j" = load {i8, {i32, i1}}, ptr %"ptr"
|
|
1241
|
+
%"k" = extractvalue {i8, {i32, i1}} %"j", 0
|
|
1242
|
+
%"l" = extractvalue {i8, {i32, i1}} %"j", 1
|
|
1243
|
+
%"m" = extractvalue {i8, {i32, i1}} %"j", 1, 0
|
|
1244
|
+
%"n" = extractvalue {i8, {i32, i1}} %"j", 1, 1
|
|
1245
|
+
%"o" = insertvalue {i8, {i32, i1}} %"j", {i32, i1} %"l", 1
|
|
1246
|
+
%"p" = insertvalue {i8, {i32, i1}} %"j", i32 %".1", 1, 0
|
|
1247
|
+
""")
|
|
1248
|
+
else:
|
|
1249
|
+
self.check_block(block, """\
|
|
1250
|
+
my_block:
|
|
1251
|
+
%"c" = extractvalue {i32, i1} {i32 4, i1 true}, 0
|
|
1252
|
+
%"d" = insertvalue {i32, i1} {i32 4, i1 true}, i32 %".1", 0
|
|
1253
|
+
%"e" = insertvalue {i32, i1} %"d", i1 false, 1
|
|
1254
|
+
%"ptr" = alloca {i8, {i32, i1}}
|
|
1255
|
+
%"j" = load {i8, {i32, i1}}, {i8, {i32, i1}}* %"ptr"
|
|
1256
|
+
%"k" = extractvalue {i8, {i32, i1}} %"j", 0
|
|
1257
|
+
%"l" = extractvalue {i8, {i32, i1}} %"j", 1
|
|
1258
|
+
%"m" = extractvalue {i8, {i32, i1}} %"j", 1, 0
|
|
1259
|
+
%"n" = extractvalue {i8, {i32, i1}} %"j", 1, 1
|
|
1260
|
+
%"o" = insertvalue {i8, {i32, i1}} %"j", {i32, i1} %"l", 1
|
|
1261
|
+
%"p" = insertvalue {i8, {i32, i1}} %"j", i32 %".1", 1, 0
|
|
1262
|
+
""")
|
|
1145
1263
|
|
|
1146
1264
|
def test_cast_ops(self):
|
|
1147
1265
|
block = self.block(name='my_block')
|
|
@@ -1160,21 +1278,39 @@ my_block:
|
|
|
1160
1278
|
j = builder.inttoptr(i, ir.PointerType(int8), 'j') # noqa F841
|
|
1161
1279
|
k = builder.bitcast(a, flt, "k") # noqa F841
|
|
1162
1280
|
self.assertFalse(block.is_terminated)
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1281
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
1282
|
+
if opaque_pointers_enabled:
|
|
1283
|
+
self.check_block(block, """\
|
|
1284
|
+
my_block:
|
|
1285
|
+
%"c" = trunc i32 %".1" to i8
|
|
1286
|
+
%"d" = zext i8 %"c" to i32
|
|
1287
|
+
%"e" = sext i8 %"c" to i32
|
|
1288
|
+
%"fb" = fptrunc double %".3" to float
|
|
1289
|
+
%"fc" = fpext float %"fb" to double
|
|
1290
|
+
%"g" = fptoui double %".3" to i32
|
|
1291
|
+
%"h" = fptosi double %".3" to i8
|
|
1292
|
+
%"fd" = uitofp i32 %"g" to float
|
|
1293
|
+
%"fe" = sitofp i8 %"h" to double
|
|
1294
|
+
%"i" = ptrtoint ptr %".4" to i32
|
|
1295
|
+
%"j" = inttoptr i32 %"i" to ptr
|
|
1296
|
+
%"k" = bitcast i32 %".1" to float
|
|
1297
|
+
""")
|
|
1298
|
+
else:
|
|
1299
|
+
self.check_block(block, """\
|
|
1300
|
+
my_block:
|
|
1301
|
+
%"c" = trunc i32 %".1" to i8
|
|
1302
|
+
%"d" = zext i8 %"c" to i32
|
|
1303
|
+
%"e" = sext i8 %"c" to i32
|
|
1304
|
+
%"fb" = fptrunc double %".3" to float
|
|
1305
|
+
%"fc" = fpext float %"fb" to double
|
|
1306
|
+
%"g" = fptoui double %".3" to i32
|
|
1307
|
+
%"h" = fptosi double %".3" to i8
|
|
1308
|
+
%"fd" = uitofp i32 %"g" to float
|
|
1309
|
+
%"fe" = sitofp i8 %"h" to double
|
|
1310
|
+
%"i" = ptrtoint i32* %".4" to i32
|
|
1311
|
+
%"j" = inttoptr i32 %"i" to i8*
|
|
1312
|
+
%"k" = bitcast i32 %".1" to float
|
|
1313
|
+
""")
|
|
1178
1314
|
|
|
1179
1315
|
def test_atomicrmw(self):
|
|
1180
1316
|
block = self.block(name='my_block')
|
|
@@ -1183,11 +1319,19 @@ my_block:
|
|
|
1183
1319
|
c = builder.alloca(int32, name='c')
|
|
1184
1320
|
d = builder.atomic_rmw('add', c, a, 'monotonic', 'd')
|
|
1185
1321
|
self.assertEqual(d.type, int32)
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1322
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
1323
|
+
if opaque_pointers_enabled:
|
|
1324
|
+
self.check_block(block, """\
|
|
1325
|
+
my_block:
|
|
1326
|
+
%"c" = alloca i32
|
|
1327
|
+
%"d" = atomicrmw add ptr %"c", i32 %".1" monotonic
|
|
1328
|
+
""")
|
|
1329
|
+
else:
|
|
1330
|
+
self.check_block(block, """\
|
|
1331
|
+
my_block:
|
|
1332
|
+
%"c" = alloca i32
|
|
1333
|
+
%"d" = atomicrmw add i32* %"c", i32 %".1" monotonic
|
|
1334
|
+
""")
|
|
1191
1335
|
|
|
1192
1336
|
def test_branch(self):
|
|
1193
1337
|
block = self.block(name='my_block')
|
|
@@ -1238,10 +1382,17 @@ my_block:
|
|
|
1238
1382
|
indirectbr.add_destination(bb_1)
|
|
1239
1383
|
indirectbr.add_destination(bb_2)
|
|
1240
1384
|
self.assertTrue(block.is_terminated)
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1385
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
1386
|
+
if opaque_pointers_enabled:
|
|
1387
|
+
self.check_block(block, """\
|
|
1388
|
+
my_block:
|
|
1389
|
+
indirectbr ptr blockaddress(@"my_func", %"b_1"), [label %"b_1", label %"b_2"]
|
|
1390
|
+
""") # noqa E501
|
|
1391
|
+
else:
|
|
1392
|
+
self.check_block(block, """\
|
|
1393
|
+
my_block:
|
|
1394
|
+
indirectbr i8* blockaddress(@"my_func", %"b_1"), [label %"b_1", label %"b_2"]
|
|
1395
|
+
""") # noqa E501
|
|
1245
1396
|
|
|
1246
1397
|
def test_returns(self):
|
|
1247
1398
|
def check(block, expected_ir):
|
|
@@ -1354,11 +1505,19 @@ my_block:
|
|
|
1354
1505
|
a = builder.alloca(int32, name="a")
|
|
1355
1506
|
b = builder.module.add_metadata(())
|
|
1356
1507
|
builder.call(dbg_declare, (a, b, b))
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1508
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
1509
|
+
if opaque_pointers_enabled:
|
|
1510
|
+
self.check_block(block, """\
|
|
1511
|
+
my_block:
|
|
1512
|
+
%"a" = alloca i32
|
|
1513
|
+
call void @"llvm.dbg.declare"(metadata ptr %"a", metadata !0, metadata !0)
|
|
1514
|
+
""") # noqa E501
|
|
1515
|
+
else:
|
|
1516
|
+
self.check_block(block, """\
|
|
1517
|
+
my_block:
|
|
1518
|
+
%"a" = alloca i32
|
|
1519
|
+
call void @"llvm.dbg.declare"(metadata i32* %"a", metadata !0, metadata !0)
|
|
1520
|
+
""") # noqa E501
|
|
1362
1521
|
|
|
1363
1522
|
def test_call_attributes(self):
|
|
1364
1523
|
block = self.block(name='my_block')
|
|
@@ -1377,12 +1536,21 @@ my_block:
|
|
|
1377
1536
|
2: 'noalias'
|
|
1378
1537
|
}
|
|
1379
1538
|
)
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1539
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
1540
|
+
if opaque_pointers_enabled:
|
|
1541
|
+
self.check_block_regex(block, """\
|
|
1542
|
+
my_block:
|
|
1543
|
+
%"retval" = alloca i32
|
|
1544
|
+
%"other" = alloca i32
|
|
1545
|
+
call void @"fun"\\(ptr noalias sret(\\(i32\\))? %"retval", i32 42, ptr noalias %"other"\\)
|
|
1546
|
+
""") # noqa E501
|
|
1547
|
+
else:
|
|
1548
|
+
self.check_block_regex(block, """\
|
|
1549
|
+
my_block:
|
|
1550
|
+
%"retval" = alloca i32
|
|
1551
|
+
%"other" = alloca i32
|
|
1552
|
+
call void @"fun"\\(i32\\* noalias sret(\\(i32\\))? %"retval", i32 42, i32\\* noalias %"other"\\)
|
|
1553
|
+
""") # noqa E501
|
|
1386
1554
|
|
|
1387
1555
|
def test_call_tail(self):
|
|
1388
1556
|
block = self.block(name='my_block')
|
|
@@ -1460,13 +1628,23 @@ my_block:
|
|
|
1460
1628
|
2: 'noalias'
|
|
1461
1629
|
}
|
|
1462
1630
|
)
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1631
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
1632
|
+
if opaque_pointers_enabled:
|
|
1633
|
+
self.check_block_regex(block, """\
|
|
1634
|
+
my_block:
|
|
1635
|
+
%"retval" = alloca i32
|
|
1636
|
+
%"other" = alloca i32
|
|
1637
|
+
invoke fast fastcc void @"fun"\\(ptr noalias sret(\\(i32\\))? %"retval", i32 42, ptr noalias %"other"\\) noinline
|
|
1638
|
+
to label %"normal" unwind label %"unwind"
|
|
1639
|
+
""") # noqa E501
|
|
1640
|
+
else:
|
|
1641
|
+
self.check_block_regex(block, """\
|
|
1642
|
+
my_block:
|
|
1643
|
+
%"retval" = alloca i32
|
|
1644
|
+
%"other" = alloca i32
|
|
1645
|
+
invoke fast fastcc void @"fun"\\(i32\\* noalias sret(\\(i32\\))? %"retval", i32 42, i32\\* noalias %"other"\\) noinline
|
|
1646
|
+
to label %"normal" unwind label %"unwind"
|
|
1647
|
+
""") # noqa E501
|
|
1470
1648
|
|
|
1471
1649
|
def test_landingpad(self):
|
|
1472
1650
|
block = self.block(name='my_block')
|
|
@@ -1480,13 +1658,23 @@ my_block:
|
|
|
1480
1658
|
lp.add_clause(ir.FilterClause(ir.Constant(ir.ArrayType(
|
|
1481
1659
|
int_typeinfo.type, 1), [int_typeinfo])))
|
|
1482
1660
|
builder.resume(lp)
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1661
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
1662
|
+
if opaque_pointers_enabled:
|
|
1663
|
+
self.check_block(block, """\
|
|
1664
|
+
my_block:
|
|
1665
|
+
%"lp" = landingpad {i32, ptr}
|
|
1666
|
+
catch ptr @"_ZTIi"
|
|
1667
|
+
filter [1 x ptr] [ptr @"_ZTIi"]
|
|
1668
|
+
resume {i32, ptr} %"lp"
|
|
1669
|
+
""")
|
|
1670
|
+
else:
|
|
1671
|
+
self.check_block(block, """\
|
|
1672
|
+
my_block:
|
|
1673
|
+
%"lp" = landingpad {i32, i8*}
|
|
1674
|
+
catch i8** @"_ZTIi"
|
|
1675
|
+
filter [1 x i8**] [i8** @"_ZTIi"]
|
|
1676
|
+
resume {i32, i8*} %"lp"
|
|
1677
|
+
""")
|
|
1490
1678
|
|
|
1491
1679
|
def test_assume(self):
|
|
1492
1680
|
block = self.block(name='my_block')
|
|
@@ -2158,10 +2346,17 @@ class TestBuilderMisc(TestBase):
|
|
|
2158
2346
|
builder = ir.IRBuilder(block)
|
|
2159
2347
|
builder.debug_metadata = builder.module.add_metadata([])
|
|
2160
2348
|
builder.alloca(ir.PointerType(int32), name='c')
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2349
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
2350
|
+
if opaque_pointers_enabled:
|
|
2351
|
+
self.check_block(block, """\
|
|
2352
|
+
my_block:
|
|
2353
|
+
%"c" = alloca ptr, !dbg !0
|
|
2354
|
+
""")
|
|
2355
|
+
else:
|
|
2356
|
+
self.check_block(block, """\
|
|
2357
|
+
my_block:
|
|
2358
|
+
%"c" = alloca i32*, !dbg !0
|
|
2359
|
+
""")
|
|
2165
2360
|
|
|
2166
2361
|
|
|
2167
2362
|
class TestTypes(TestBase):
|
|
@@ -2236,18 +2431,36 @@ class TestTypes(TestBase):
|
|
|
2236
2431
|
'i1 (float, ...)')
|
|
2237
2432
|
self.assertEqual(str(ir.FunctionType(int1, (flt, dbl), var_arg=True)),
|
|
2238
2433
|
'i1 (float, double, ...)')
|
|
2239
|
-
|
|
2240
|
-
|
|
2434
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
2435
|
+
if opaque_pointers_enabled:
|
|
2436
|
+
self.assertEqual(str(ir.PointerType(int32)), 'ptr')
|
|
2437
|
+
self.assertEqual(str(ir.PointerType(ir.PointerType(int32))), 'ptr')
|
|
2438
|
+
else:
|
|
2439
|
+
self.assertEqual(str(ir.PointerType(int32)), 'i32*')
|
|
2440
|
+
self.assertEqual(str(ir.PointerType(ir.PointerType(int32))),
|
|
2441
|
+
'i32**')
|
|
2241
2442
|
self.assertEqual(str(ir.ArrayType(int1, 5)), '[5 x i1]')
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2443
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
2444
|
+
if opaque_pointers_enabled:
|
|
2445
|
+
self.assertEqual(str(ir.ArrayType(ir.PointerType(int1), 5)),
|
|
2446
|
+
'[5 x ptr]')
|
|
2447
|
+
self.assertEqual(str(ir.PointerType(ir.ArrayType(int1, 5))), 'ptr')
|
|
2448
|
+
else:
|
|
2449
|
+
self.assertEqual(str(ir.ArrayType(ir.PointerType(int1), 5)),
|
|
2450
|
+
'[5 x i1*]')
|
|
2451
|
+
self.assertEqual(str(ir.PointerType(ir.ArrayType(int1, 5))),
|
|
2452
|
+
'[5 x i1]*')
|
|
2246
2453
|
self.assertEqual(str(ir.LiteralStructType((int1,))), '{i1}')
|
|
2247
2454
|
self.assertEqual(str(ir.LiteralStructType((int1, flt))), '{i1, float}')
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2455
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
2456
|
+
if opaque_pointers_enabled:
|
|
2457
|
+
self.assertEqual(str(ir.LiteralStructType((
|
|
2458
|
+
ir.PointerType(int1), ir.LiteralStructType((int32, int8))))),
|
|
2459
|
+
'{ptr, {i32, i8}}')
|
|
2460
|
+
else:
|
|
2461
|
+
self.assertEqual(str(ir.LiteralStructType((
|
|
2462
|
+
ir.PointerType(int1), ir.LiteralStructType((int32, int8))))),
|
|
2463
|
+
'{i1*, {i32, i8}}')
|
|
2251
2464
|
self.assertEqual(str(ir.LiteralStructType((int1,), packed=True)),
|
|
2252
2465
|
'<{i1}>')
|
|
2253
2466
|
self.assertEqual(str(ir.LiteralStructType((int1, flt), packed=True)),
|
|
@@ -2338,6 +2551,20 @@ class TestTypes(TestBase):
|
|
|
2338
2551
|
self.assert_valid_ir(module)
|
|
2339
2552
|
self.assertNotEqual(oldstr, str(module))
|
|
2340
2553
|
|
|
2554
|
+
def test_identified_struct_packed(self):
|
|
2555
|
+
td = llvm.create_target_data("e-m:e-i64:64-f80:128-n8:16:32:64-S128")
|
|
2556
|
+
context = ir.Context()
|
|
2557
|
+
mytype = context.get_identified_type("MyType", True)
|
|
2558
|
+
module = ir.Module(context=context)
|
|
2559
|
+
self.assertTrue(mytype.is_opaque)
|
|
2560
|
+
self.assert_valid_ir(module)
|
|
2561
|
+
oldstr = str(module)
|
|
2562
|
+
mytype.set_body(ir.IntType(16), ir.IntType(64), ir.FloatType())
|
|
2563
|
+
self.assertEqual(mytype.get_element_offset(td, 1, context), 2)
|
|
2564
|
+
self.assertFalse(mytype.is_opaque)
|
|
2565
|
+
self.assert_valid_ir(module)
|
|
2566
|
+
self.assertNotEqual(oldstr, str(module))
|
|
2567
|
+
|
|
2341
2568
|
def test_target_data_non_default_context(self):
|
|
2342
2569
|
context = ir.Context()
|
|
2343
2570
|
mytype = context.get_identified_type("MyType")
|
|
@@ -2524,8 +2751,13 @@ class TestConstant(TestBase):
|
|
|
2524
2751
|
tp = ir.LiteralStructType((flt, int1))
|
|
2525
2752
|
gv = ir.GlobalVariable(m, tp, "myconstant")
|
|
2526
2753
|
c = gv.gep([ir.Constant(int32, x) for x in (0, 1)])
|
|
2527
|
-
|
|
2528
|
-
|
|
2754
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
2755
|
+
if opaque_pointers_enabled:
|
|
2756
|
+
self.assertEqual(str(c),
|
|
2757
|
+
'getelementptr ({float, i1}, ptr @"myconstant", i32 0, i32 1)') # noqa E501
|
|
2758
|
+
else:
|
|
2759
|
+
self.assertEqual(str(c),
|
|
2760
|
+
'getelementptr ({float, i1}, {float, i1}* @"myconstant", i32 0, i32 1)') # noqa E501
|
|
2529
2761
|
self.assertEqual(c.type, ir.PointerType(int1))
|
|
2530
2762
|
|
|
2531
2763
|
const = ir.Constant(tp, None)
|
|
@@ -2534,8 +2766,13 @@ class TestConstant(TestBase):
|
|
|
2534
2766
|
|
|
2535
2767
|
const_ptr = ir.Constant(tp.as_pointer(), None)
|
|
2536
2768
|
c2 = const_ptr.gep([ir.Constant(int32, 0)])
|
|
2537
|
-
|
|
2538
|
-
|
|
2769
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
2770
|
+
if opaque_pointers_enabled:
|
|
2771
|
+
self.assertEqual(str(c2),
|
|
2772
|
+
'getelementptr ({float, i1}, ptr null, i32 0)') # noqa E501
|
|
2773
|
+
else:
|
|
2774
|
+
self.assertEqual(str(c2),
|
|
2775
|
+
'getelementptr ({float, i1}, {float, i1}* null, i32 0)') # noqa E501
|
|
2539
2776
|
self.assertEqual(c.type, ir.PointerType(int1))
|
|
2540
2777
|
|
|
2541
2778
|
def test_gep_addrspace_globalvar(self):
|
|
@@ -2547,9 +2784,15 @@ class TestConstant(TestBase):
|
|
|
2547
2784
|
self.assertEqual(gv.addrspace, addrspace)
|
|
2548
2785
|
c = gv.gep([ir.Constant(int32, x) for x in (0, 1)])
|
|
2549
2786
|
self.assertEqual(c.type.addrspace, addrspace)
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2787
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
2788
|
+
if opaque_pointers_enabled:
|
|
2789
|
+
self.assertEqual(str(c),
|
|
2790
|
+
('getelementptr ({float, i1}, ptr '
|
|
2791
|
+
'addrspace(4) @"myconstant", i32 0, i32 1)'))
|
|
2792
|
+
else:
|
|
2793
|
+
self.assertEqual(str(c),
|
|
2794
|
+
('getelementptr ({float, i1}, {float, i1} '
|
|
2795
|
+
'addrspace(4)* @"myconstant", i32 0, i32 1)'))
|
|
2553
2796
|
self.assertEqual(c.type, ir.PointerType(int1, addrspace=addrspace))
|
|
2554
2797
|
|
|
2555
2798
|
def test_trunc(self):
|
|
@@ -2576,7 +2819,11 @@ class TestConstant(TestBase):
|
|
|
2576
2819
|
m = self.module()
|
|
2577
2820
|
gv = ir.GlobalVariable(m, int32, "myconstant")
|
|
2578
2821
|
c = gv.bitcast(int64.as_pointer())
|
|
2579
|
-
|
|
2822
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
2823
|
+
if opaque_pointers_enabled:
|
|
2824
|
+
self.assertEqual(str(c), 'bitcast (ptr @"myconstant" to ptr)')
|
|
2825
|
+
else:
|
|
2826
|
+
self.assertEqual(str(c), 'bitcast (i32* @"myconstant" to i64*)')
|
|
2580
2827
|
|
|
2581
2828
|
def test_fptoui(self):
|
|
2582
2829
|
c = ir.Constant(flt, 1).fptoui(int32)
|
|
@@ -2601,19 +2848,33 @@ class TestConstant(TestBase):
|
|
|
2601
2848
|
|
|
2602
2849
|
self.assertRaises(TypeError, one.ptrtoint, int64)
|
|
2603
2850
|
self.assertRaises(TypeError, ptr.ptrtoint, flt)
|
|
2604
|
-
|
|
2851
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
2852
|
+
if opaque_pointers_enabled:
|
|
2853
|
+
self.assertEqual(str(c), 'ptrtoint (ptr null to i32)')
|
|
2854
|
+
else:
|
|
2855
|
+
self.assertEqual(str(c), 'ptrtoint (i64* null to i32)')
|
|
2605
2856
|
|
|
2606
2857
|
def test_ptrtoint_2(self):
|
|
2607
2858
|
m = self.module()
|
|
2608
2859
|
gv = ir.GlobalVariable(m, int32, "myconstant")
|
|
2609
2860
|
c = gv.ptrtoint(int64)
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2861
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
2862
|
+
if opaque_pointers_enabled:
|
|
2863
|
+
self.assertEqual(str(c), 'ptrtoint (ptr @"myconstant" to i64)')
|
|
2864
|
+
|
|
2865
|
+
self.assertRaisesRegex(
|
|
2866
|
+
TypeError,
|
|
2867
|
+
r"can only ptrtoint\(\) to integer type, not 'ptr'",
|
|
2868
|
+
gv.ptrtoint,
|
|
2869
|
+
int64.as_pointer())
|
|
2870
|
+
else:
|
|
2871
|
+
self.assertEqual(str(c), 'ptrtoint (i32* @"myconstant" to i64)')
|
|
2872
|
+
|
|
2873
|
+
self.assertRaisesRegex(
|
|
2874
|
+
TypeError,
|
|
2875
|
+
r"can only ptrtoint\(\) to integer type, not 'i64\*'",
|
|
2876
|
+
gv.ptrtoint,
|
|
2877
|
+
int64.as_pointer())
|
|
2617
2878
|
|
|
2618
2879
|
c2 = ir.Constant(int32, 0)
|
|
2619
2880
|
self.assertRaisesRegex(
|
|
@@ -2629,7 +2890,11 @@ class TestConstant(TestBase):
|
|
|
2629
2890
|
|
|
2630
2891
|
self.assertRaises(TypeError, one.inttoptr, int64)
|
|
2631
2892
|
self.assertRaises(TypeError, pi.inttoptr, int64.as_pointer())
|
|
2632
|
-
|
|
2893
|
+
# FIXME: Remove `else' once TP are no longer supported.
|
|
2894
|
+
if opaque_pointers_enabled:
|
|
2895
|
+
self.assertEqual(str(c), 'inttoptr (i32 1 to ptr)')
|
|
2896
|
+
else:
|
|
2897
|
+
self.assertEqual(str(c), 'inttoptr (i32 1 to i64*)')
|
|
2633
2898
|
|
|
2634
2899
|
def test_neg(self):
|
|
2635
2900
|
one = ir.Constant(int32, 1)
|