diff --git a/llvm/test/Transforms/MemCpyOpt/memcpy.ll b/llvm/test/Transforms/MemCpyOpt/memcpy.ll index 412ffd5d53e0ec..d7475e7f5ea591 100644 --- a/llvm/test/Transforms/MemCpyOpt/memcpy.ll +++ b/llvm/test/Transforms/MemCpyOpt/memcpy.ll @@ -694,3 +694,20 @@ define void @immut_valid_align_branched(i1 %c, ptr noalias align 4 %val) { call void @f(ptr nocapture noalias readonly %val3) ret void } + +; FIXME: This is a miscompile. +define void @immut_param_noalias_metadata(ptr align 4 byval(i32) %ptr) { +; CHECK-LABEL: @immut_param_noalias_metadata( +; CHECK-NEXT: call void @f(ptr noalias nocapture readonly [[PTR:%.*]]), !alias.scope !0 +; CHECK-NEXT: ret void +; + %tmp = alloca i32, align 4 + store i32 1, ptr %ptr, !noalias !2 + call void @llvm.memcpy.p0.p0.i64(ptr align 4 %tmp, ptr align 4 %ptr, i64 4, i1 false) + call void @f(ptr nocapture noalias readonly %tmp), !alias.scope !2 + ret void +} + +!0 = !{!0} +!1 = !{!1, !0} +!2 = !{!1}