2016-04-21 12:46:22 +08:00
|
|
|
; RUN: llvm-as %s -o %t.o
|
|
|
|
|
2016-04-22 01:46:38 +08:00
|
|
|
; RUN: ld.lld -m elf_x86_64 -shared -save-temps %t.o -o %t2.o
|
2016-09-29 08:40:08 +08:00
|
|
|
; RUN: llvm-dis < %t2.o.0.0.preopt.bc | FileCheck %s
|
2016-04-21 12:46:22 +08:00
|
|
|
|
|
|
|
; CHECK: @GlobalValueName
|
|
|
|
; CHECK: @foo(i32 %in)
|
|
|
|
; CHECK: somelabel:
|
|
|
|
; CHECK: %GV = load i32, i32* @GlobalValueName
|
|
|
|
; CHECK: %add = add i32 %in, %GV
|
|
|
|
; CHECK: ret i32 %add
|
|
|
|
|
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
|
|
|
|
@GlobalValueName = global i32 0
|
|
|
|
|
|
|
|
define i32 @foo(i32 %in) {
|
|
|
|
somelabel:
|
|
|
|
%GV = load i32, i32* @GlobalValueName
|
|
|
|
%add = add i32 %in, %GV
|
|
|
|
ret i32 %add
|
|
|
|
}
|