llvm-project/llvm/test/Assembler/non-global-value-max-name-size.ll
Arthur Eubanks 24a08593b9 [LLParser] Error out if a name is too long and gets renamed
Typically names longer than -non-global-value-max-name-size will just get renamed if there is a collision after truncating. This is fine since we typically don't reference Values by name.

However LLParser does reference Values by name, so report an error when that happens, otherwise weird issues can crop up if there are name collisions (e.g. verifier issues with the changed test case because we end up reusing the same block for `testz` and `testa`).

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D145282
2023-03-06 15:43:34 -08:00

16 lines
254 B
LLVM

; RUN: opt < %s -S -non-global-value-max-name-size=5
; RUN: not opt < %s -S -non-global-value-max-name-size=4 2>&1 | FileCheck %s
; CHECK: name is too long
define void @f() {
bb0:
br label %testz
testz:
br label %testa
testa:
br label %testz
}