Add tests for reordering between ptrtoint & free
ADD
tests/alive-tv/memory/ptrtoint-free-reorder-fail.src.ll
+target datalayout = "e-p:64:64"
+define i64 @f() {
+ %p = call noalias i8* @malloc(i64 10)
+ %c = icmp eq i8* %p, null
+ br i1 %c, label %EXIT, label %BB
+EXIT:
+ ret i64 1
+BB:
+ call void @free(i8* %p)
+ %i = ptrtoint i8* %p to i64
+ ret i64 %i
+}
+
+; ERROR: Value mismatch
+declare void @free(i8*)
+declare noalias i8* @malloc(i64)

ADD
tests/alive-tv/memory/ptrtoint-free-reorder-fail.tgt.ll
+target datalayout = "e-p:64:64"
+define i64 @f() {
+ %p = call noalias i8* @malloc(i64 10)
+ %i0 = ptrtoint i8* %p to i64
+ %i = add i64 %i0, 1
+ call void @free(i8* %p)
+ ret i64 %i
+}
+
+declare void @free(i8*)
+declare noalias i8* @malloc(i64)

ADD
tests/alive-tv/memory/ptrtoint-free-reorder.src.ll
+target datalayout = "e-p:64:64"
+define i64 @f() {
+ %p = call noalias i8* @malloc(i64 10)
+ call void @free(i8* %p)
+ %i = ptrtoint i8* %p to i64
+ ret i64 %i
+}
+
+declare void @free(i8*)
+declare noalias i8* @malloc(i64)

ADD
tests/alive-tv/memory/ptrtoint-free-reorder.tgt.ll
+target datalayout = "e-p:64:64"
+define i64 @f() {
+ %p = call noalias i8* @malloc(i64 10)
+ %i = ptrtoint i8* %p to i64
+ call void @free(i8* %p)
+ ret i64 %i
+}
+
+declare void @free(i8*)
+declare noalias i8* @malloc(i64)

Add tests for reordering between ptrtoint & free (#214)