xref: /llvm-project/llvm/test/Bitcode/value-with-long-name.ll (revision 3864bfd2e0ce7e32fd623c550660885599383e6a)
1; Check the size of generated variable when no option is set
2; RUN: opt -S %s -O2 -o - | FileCheck -check-prefix=CHECK-LONG %s
3; RUN: opt -S %s -O2 -o - -non-global-value-max-name-size=-1 | FileCheck -check-prefix=CHECK-LONG %s
4; CHECK-LONG: %{{[a-z]{4}[a-z]+}}
5
6; Then check we correctly cap the size of newly generated non-global values name
7; Force the size to be small so that the check works on release and debug build
8; RUN: opt -S %s -O2 -o - -non-global-value-max-name-size=1 | FileCheck -check-prefix=CHECK-SHORT %s
9; CHECK-SHORT-NOT: %{{[a-z][a-z]+}}
10
11define i32 @f(i32 %a, i32 %b) {
12  %c = add i32 %a, %b
13  %d = add i32 %c, %a
14  %e = add i32 %d, %b
15  ret i32 %e
16}
17