define void @foo(i32 %v) {
entry:
-; CHECK: <stdin>:[[@LINE+1]]:{{[0-9]+}}: error: unexpected function-local metadata
+; CHECK: <stdin>:[[@LINE+1]]:{{[0-9]+}}: error: invalid use of function-local name
call void @llvm.bar(metadata !{i32 0, i32 %v})
ret void
}