1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/Feature/strip_names.ll
Tim Northover e5745c32fd IR: print value numbers for unnamed function arguments
For consistency with normal instructions and clarity when reading IR,
it's best to print the %0, %1, ... names of function arguments in
definitions.

Also modifies the parser to accept IR in that form for obvious reasons.

llvm-svn: 367755
2019-08-03 14:28:34 +00:00

27 lines
626 B
LLVM

; RUN: opt < %s -S | FileCheck %s
; RUN: opt < %s | opt -S -discard-value-names | FileCheck --check-prefix=NONAME %s
; CHECK: @GlobalValueName
; CHECK: @foo(i32 %in)
; CHECK: somelabel:
; CHECK: %GV = load i32, i32* @GlobalValueName
; CHECK: %add = add i32 %in, %GV
; CHECK: ret i32 %add
; NONAME: @GlobalValueName
; NONAME: @foo(i32 %0)
; NONAME-NOT: somelabel:
; NONAME: %2 = load i32, i32* @GlobalValueName
; NONAME: %3 = add i32 %0, %2
; NONAME: ret i32 %3
@GlobalValueName = global i32 0
define i32 @foo(i32 %in) {
somelabel:
%GV = load i32, i32* @GlobalValueName
%add = add i32 %in, %GV
ret i32 %add
}