Test Failure: Transforms/CodeGenPrepare/X86/memset_chk-simplify-nobuiltin.ll

Test source: git

Comments: __memset_chk() not recognized as a builtin on purpose. Need to detect this case.

Log:

Source: <stdin>

----------------------------------------
declare ptr @__memset_chk(ptr, i32, i64, i64)

define void @test_nobuiltin(ptr %dst, i64 %len) {
#0:
  %#1 = call ptr @__memset_chk(ptr %dst, i32 0, i64 %len, i64 -1)
  ret void
}
=>
define void @test_nobuiltin(ptr %dst, i64 %len) {
#0:
  memset ptr %dst align 1, i8 0, i64 %len
  ret void
}
Transformation doesn't verify! (unsound)
ERROR: Source is more defined than target

Example:
ptr %dst = null
i64 %len = poison

Source:
ptr %#1 = function did not return!

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0	alive: false	address: 0
Block 1 >	size: 0	align: 1	alloc type: 0	alive: true	address: 1
Block 2 >	size: 0	align: 4611686018427387904	alloc type: 0	alive: true	address: 4611686018427387904
Block 3 >	size: 0	align: 4611686018427387904	alloc type: 0	alive: true	address: 4611686018427387904

Target:
void = UB triggered!


Pass: 
Command line: '/home/nlopes/llvm/build/bin/opt' '-load=/home/nlopes/alive2/build/tv/tv.so' '-tv-exit-on-error' '-tv' '-S' '-mtriple=x86_64' '-disable-simplify-libcalls' '-codegenprepare' '-tv' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats'


------------------- SMT STATS -------------------
Num queries: 23
Num invalid: 0
Num skips:   0
Num trivial: 1 (4.2%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     22 (95.7%)
Num UNSAT:   1 (4.3%)
Alive2: Transform doesn't verify; aborting!

stderr:

RUN: at line 2: /home/nlopes/alive2/build/opt-alive.sh -S -mtriple=x86_64 -disable-simplify-libcalls -codegenprepare < /bitbucket/nlopes/llvm/llvm/test/Transforms/CodeGenPrepare/X86/memset_chk-simplify-nobuiltin.ll | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/CodeGenPrepare/X86/memset_chk-simplify-nobuiltin.ll
+ /home/nlopes/alive2/build/opt-alive.sh -S -mtriple=x86_64 -disable-simplify-libcalls -codegenprepare
+ /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/CodeGenPrepare/X86/memset_chk-simplify-nobuiltin.ll

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/CodeGenPrepare/X86/memset_chk-simplify-nobuiltin.ll

 

<-- Back