[AArch64][FastISel] Fix integer extend optimization.
[oota-llvm.git] / test / CodeGen / AArch64 / sdivpow2.ll
index 6dee06dbd650a83b2f07b38507a671290f93b317..6c02ea9a467f5f0bee38bb1773255091bd97c9b4 100644 (file)
@@ -1,4 +1,5 @@
-; RUN: llc -mtriple=arm64-linux-gnu -o - %s | FileCheck %s
+; RUN: llc -mtriple=arm64-linux-gnu -fast-isel=0 -verify-machineinstrs < %s | FileCheck %s
+; RUN: llc -mtriple=arm64-linux-gnu -fast-isel=1 -verify-machineinstrs < %s | FileCheck %s
 
 define i32 @test1(i32 %x) {
 ; CHECK-LABEL: test1
@@ -59,3 +60,15 @@ define i64 @test6(i64 %x) {
   %div = sdiv i64 %x, 64
   ret i64 %div
 }
+
+define i64 @test7(i64 %x) {
+; CHECK-LABEL: test7
+; CHECK: orr [[REG:x[0-9]+]], xzr, #0xffffffffffff
+; CHECK: add x8, x0, [[REG]]
+; CHECK: cmp x0, #0
+; CHECK: csel x8, x8, x0, lt
+; CHECK: asr x0, x8, #48
+  %div = sdiv i64 %x, 281474976710656
+  ret i64 %div
+}
+