"blockaddress may not be used with the entry block!", Entry);
}
- unsigned NumDebugAttachments = 0;
+ unsigned NumDebugAttachments = 0, NumProfAttachments = 0;
// Visit metadata attachments.
for (const auto &I : MDs) {
// Verify that the attachment is legal.
AssertDI(isa<DISubprogram>(I.second),
"function !dbg attachment must be a subprogram", &F, I.second);
break;
+ case LLVMContext::MD_prof:
+ ++NumProfAttachments;
+ Assert(NumProfAttachments == 1,
+ "function must have a single !prof attachment", &F, I.second);
+ break;
}
// Verify the metadata itself.
--- /dev/null
+; RUN: not llvm-as %s -disable-output 2>&1 | FileCheck %s
+
+define void @foo() !prof !0 {
+ unreachable
+}
+
+; CHECK: function must have a single !prof attachment
+define void @foo2() !prof !0 !prof !0 {
+ unreachable
+}
+
+!0 = !{}