blob: aa7da5f5b7dba95e5b6919be42a7a44e4dc180cd [file] [log] [blame]
Serge Guelton4c975572018-01-05 19:41:19 +00001; Check the size of generated variable when no option is set
2; RUN: opt -S %s -O2 -o - | FileCheck -check-prefix=CHECK-LONG %s
Daniil Fukalov3864bfd2024-05-28 16:09:53 +02003; RUN: opt -S %s -O2 -o - -non-global-value-max-name-size=-1 | FileCheck -check-prefix=CHECK-LONG %s
Serge Guelton4c975572018-01-05 19:41:19 +00004; 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
Serge Guelton4c975572018-01-05 19:41:19 +00008; 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}