LowerConstantIntrinsics: Fix missing test for byval behavior

This commit is contained in:
Matt Arsenault 2020-06-29 14:21:46 -04:00
parent 2790516418
commit 7c308dc80a
1 changed files with 8 additions and 0 deletions

View File

@ -81,3 +81,11 @@ entry:
i1 false, i1 false)
ret i64 %0
}
; CHECK-LABEL: @test_objectsize_byval_arg(
; CHECK: ret i64 42
define i64 @test_objectsize_byval_arg([42 x i8]* byval([42 x i8]) %ptr) {
%cast = bitcast [42 x i8]* %ptr to i8*
%size = tail call i64 @llvm.objectsize.i64(i8* %cast, i1 true, i1 false, i1 false)
ret i64 %size
}