R600: Correctly set the src value offset for scalarized kernel args
[oota-llvm.git] / test / CodeGen / Thumb2 / thumb2-sbc.ll
index 09e3fdd85381342036a4ec39779a614835599f82..b04dae61cef75ef21688727acff3779035ce42e3 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llc -march=thumb -mattr=+thumb2 < %s | FileCheck %s
+; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2 %s -o - | FileCheck %s
 
 define i64 @f1(i64 %a, i64 %b) {
 ; CHECK: f1
@@ -52,3 +52,17 @@ define i64 @f6(i64 %a) {
     ret i64 %tmp
 }
 
+; Example from numerics code that manually computes wider-than-64 values.
+;
+; CHECK-LABEL: livecarry:
+; CHECK: adds
+; CHECK: adc
+define i64 @livecarry(i64 %carry, i32 %digit) nounwind {
+  %ch = lshr i64 %carry, 32
+  %cl = and i64 %carry, 4294967295
+  %truncdigit = zext i32 %digit to i64
+  %prod = add i64 %cl, %truncdigit
+  %ph = lshr i64 %prod, 32
+  %carryresult = add i64 %ch, %ph
+  ret i64 %carryresult
+}