2016-04-22 02:56:45 +08:00
|
|
|
; RUN: llc -march=hexagon < %s | FileCheck %s
|
2011-12-13 05:14:40 +08:00
|
|
|
|
|
|
|
@num = external global i32
|
|
|
|
@acc = external global i32
|
|
|
|
@val = external global i32
|
|
|
|
|
2017-02-07 07:18:57 +08:00
|
|
|
; CHECK-DAG: memw(gp+#num)
|
|
|
|
; CHECK-DAG: memw(gp+#acc)
|
|
|
|
; CHECK-DAG: memw(gp+#val)
|
2011-12-13 05:14:40 +08:00
|
|
|
|
|
|
|
define void @foo() nounwind {
|
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load i32, i32* @num, align 4
|
|
|
|
%1 = load i32, i32* @acc, align 4
|
2011-12-13 05:14:40 +08:00
|
|
|
%mul = mul nsw i32 %0, %1
|
2015-02-28 05:17:42 +08:00
|
|
|
%2 = load i32, i32* @val, align 4
|
2011-12-13 05:14:40 +08:00
|
|
|
%add = add nsw i32 %mul, %2
|
|
|
|
store i32 %add, i32* @num, align 4
|
|
|
|
ret void
|
|
|
|
}
|