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}