Test Failure: Transforms/InstCombine/malloc-free-delete.ll

Test source: git

Log:

Source: <stdin>
ERROR: Unsupported instruction:   call void @llvm.lifetime.start.p0i8(i64 10, i8* %a)
ERROR: Unsupported instruction:   store volatile i8 4, i8* %g, align 1
ERROR: Unsupported instruction:   invoke void @_ZN1AC2Ev(i8* undef)
          to label %.noexc.i unwind label %lpad.i
ERROR: Unsupported instruction:   call void @llvm.assume(i1 true) [ "align"(i8* %nwa3, i64 16) ]
ERROR: Unsupported attribute: nofree

----------------------------------------
define i32 @main(i32 %argc, * %argv) {
%0:
  %c_19 = alloca i64 8, align 8
  %__constexpr_2 = gep * null, 1 x i32 1
  %__constexpr_1 = ptrtoint * %__constexpr_2 to i32
  %__constexpr_0 = mul i32 %__constexpr_1, 10
  %malloc_206 = malloc i32 %__constexpr_0
  store * %malloc_206, * %c_19, align 8
  %tmp_207 = load *, * %c_19, align 8
  free * %tmp_207
  ret i32 0
}
=>
define i32 @main(i32 %argc, * %argv) {
%0:
  ret i32 0
}
Transformation seems to be correct!


----------------------------------------
define i32 @dead_aligned_alloc(i32 %size, i32 %alignment, i8 %value) {
%0:
  %aligned_allocation = call * @aligned_alloc(i32 %alignment, i32 %size)
  store i8 %value, * %aligned_allocation, align 1
  free * %aligned_allocation
  ret i32 0
}
=>
define i32 @dead_aligned_alloc(i32 %size, i32 %alignment, i8 %value) {
%0:
  ret i32 0
}
Transformation doesn't verify!
ERROR: Couldn't prove the correctness of the transformation
Alive2 approximated the semantics of the programs and therefore we
cannot conclude whether the bug found is valid or not.

Approximations done:
 - Unknown libcall: @aligned_alloc



----------------------------------------
define i1 @foo() {
%0:
  %m = malloc i32 1
  %z = icmp eq * %m, null
  free * %m
  ret i1 %z
}
=>
define i1 @foo() {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define void @test4() {
%0:
  %A = malloc i32 16000
  %B = bitcast * %A to *
  %C = bitcast * %B to *
  free * %C
  ret void
}
=>
define void @test4() {
%0:
  ret void
}
Transformation seems to be correct!

ERROR: Unsupported instruction:   store volatile i8 4, i8* %g, align 1

----------------------------------------
define void @test6(* %foo) {
%entry:
  %tobool = icmp eq * %foo, null
  br i1 %tobool, label %if.end, label %if.then

%if.then:
  free * %foo
  br label %if.end

%if.end:
  ret void
}
=>
define void @test6(* %foo) {
%entry:
  %tobool = icmp eq * %foo, null
  free * %foo
  br i1 %tobool, label %if.end, label %if.then

%if.then:
  br label %if.end

%if.end:
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test6a(* %foo) {
%entry:
  %tobool = icmp eq * %foo, null
  br i1 %tobool, label %if.end, label %if.then

%if.then:
  free * %foo
  br label %if.end

%if.end:
  ret void
}
=>
define void @test6a(* %foo) {
%entry:
  %tobool = icmp eq * %foo, null
  br i1 %tobool, label %if.end, label %if.then

%if.then:
  free * %foo
  br label %if.end

%if.end:
  ret void
}
Transformation seems to be correct!

ERROR: Unsupported instruction:   invoke void @_ZN1AC2Ev(i8* undef)
          to label %.noexc.i unwind label %lpad.i

----------------------------------------
define * @_Znwj(i32 %n) {
%0:
  %z = zext i32 %n to i64
  %m = call * @_Znwm(i64 %z)
  ret * %m
}
=>
define * @_Znwj(i32 %n) {
%0:
  %z = zext i32 %n to i64
  %m = call * @_Znwm(i64 %z)
  ret * %m
}
Transformation seems to be correct!


----------------------------------------
define void @_ZdlPvm(* %p, i64 %0) {
%1:
  call void @_ZdlPv(* %p)
  ret void
}
=>
define void @_ZdlPvm(* %p, i64 %0) {
%1:
  call void @_ZdlPv(* %p)
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @_ZdlPvj(* %p, i32 %0) {
%1:
  call void @_ZdlPv(* %p)
  ret void
}
=>
define void @_ZdlPvj(* %p, i32 %0) {
%1:
  call void @_ZdlPv(* %p)
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @_ZdaPvm(* %p, i64 %0) {
%1:
  call void @_ZdaPv(* %p)
  ret void
}
=>
define void @_ZdaPvm(* %p, i64 %0) {
%1:
  call void @_ZdaPv(* %p)
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @_ZdaPvj(* %p, i32 %0) {
%1:
  call void @_ZdaPv(* %p)
  ret void
}
=>
define void @_ZdaPvj(* %p, i32 %0) {
%1:
  call void @_ZdaPv(* %p)
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test9() {
%0:
  %new_long_long = malloc i64 32
  free * %new_long_long
  ret void
}
=>
define void @test9() {
%0:
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test10() {
%0:
  call void @_ZdlPv(* null)
  ret void
}
=>
define void @test10() {
%0:
  call void @_ZdlPv(* null)
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test11() {
%0:
  %call = malloc i64 8
  call void @_ZdlPv(* %call)
  ret void
}
=>
define void @test11() {
%0:
  %call = malloc i64 8
  call void @_ZdlPv(nonnull * %call)
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test12(* %foo) {
%entry:
  %tobool = icmp eq * %foo, null
  br i1 %tobool, label %if.end, label %if.then

%if.then:
  %bitcast = bitcast * %foo to *
  free * %bitcast
  br label %if.end

%if.end:
  ret void
}
=>
define void @test12(* %foo) {
%entry:
  %tobool = icmp eq * %foo, null
  %bitcast = bitcast * %foo to *
  free * %bitcast
  br i1 %tobool, label %if.end, label %if.then

%if.then:
  br label %if.end

%if.end:
  ret void
}
Transformation seems to be correct!

ERROR: Unsupported attribute: nofree

----------------------------------------
define void @test14(* %foo) nofree {
%0:
  free * %foo
  ret void
}
=>
define void @test14(* %foo) nofree {
%0:
  store i1 1, * undef, align 1
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test15(* %foo) {
%0:
  free * %foo
  ret void
}
=>
define void @test15(* %foo) {
%0:
  store i1 1, * undef, align 1
  ret void
}
Transformation doesn't verify!
ERROR: Source is more defined than target

Example:
* %foo = pointer(non-local, block_id=1, offset=0)

Source:

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0
Block 1 >	size: 0	align: 8	alloc type: 2

Target:



------------------- SMT STATS -------------------
Num queries: 31
Num invalid: 0
Num skips:   0
Num trivial: 83 (72.8%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     19 (61.3%)
Num UNSAT:   12 (38.7%)

stderr:

+ : 'RUN: at line 2'
+ /home/nlopes/alive2/build/opt-alive.sh -instcombine -S
+ /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstCombine/malloc-free-delete.ll

Alive2: Transform doesn't verify; aborting!
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstCombine/malloc-free-delete.ll

 

<-- Back