diff --git a/llvm/include/llvm/AsmParser/LLParser.h b/llvm/include/llvm/AsmParser/LLParser.h index 1ef8b8ffc3966..8b195b028783f 100644 --- a/llvm/include/llvm/AsmParser/LLParser.h +++ b/llvm/include/llvm/AsmParser/LLParser.h @@ -91,12 +91,15 @@ namespace llvm { } bool operator<(const ValID &RHS) const { - assert(Kind == RHS.Kind && "Comparing ValIDs of different kinds"); + assert((((Kind == t_LocalID || Kind == t_LocalName) && + (RHS.Kind == t_LocalID || RHS.Kind == t_LocalName)) || + ((Kind == t_GlobalID || Kind == t_GlobalName) && + (RHS.Kind == t_GlobalID || RHS.Kind == t_GlobalName))) && + "Comparing ValIDs of different kinds"); + if (Kind != RHS.Kind) + return Kind < RHS.Kind; if (Kind == t_LocalID || Kind == t_GlobalID) return UIntVal < RHS.UIntVal; - assert((Kind == t_LocalName || Kind == t_GlobalName || - Kind == t_ConstantStruct || Kind == t_PackedConstantStruct) && - "Ordering not defined for this ValID kind yet"); return StrVal < RHS.StrVal; } }; diff --git a/llvm/test/Assembler/pr119818.ll b/llvm/test/Assembler/pr119818.ll new file mode 100644 index 0000000000000..568648424e4ac --- /dev/null +++ b/llvm/test/Assembler/pr119818.ll @@ -0,0 +1,23 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 +; RUN: opt -S < %s | FileCheck %s + +@vm_exec_core.insns_address_table = internal constant [2 x ptr] [ptr blockaddress(@vm_exec_core, %0), ptr blockaddress(@vm_exec_core, %block)], align 16 + +define void @vm_exec_core() { +; CHECK-LABEL: define void @vm_exec_core() { +; CHECK-NEXT: [[ENTRY:.*:]] +; CHECK-NEXT: br label %[[BLOCK:.*]] +; CHECK: [[BLOCK]]: +; CHECK-NEXT: br label %[[BB0:.*]] +; CHECK: [[BB0]]: +; CHECK-NEXT: ret void +; +entry: + br label %block + +block: + br label %0 + +0: + ret void +}