[x32] Fix FrameIndex check in SelectLEA64_32Addr
[oota-llvm.git] / test / CodeGen / X86 / x86-64-sret-return.ll
index 3ee1a0b21ebd70cf168e375500f348ca29435df1..2d001142d7a105ff0fa89203a9458707bc831fdc 100644 (file)
@@ -1,8 +1,15 @@
-; RUN: llc < %s
+; RUN: llc -mtriple=x86_64-apple-darwin8 < %s | FileCheck %s
+; RUN: llc -mtriple=x86_64-pc-linux < %s | FileCheck %s
+; RUN: llc -mtriple=x86_64-pc-linux-gnux32 < %s | FileCheck -check-prefix=X32ABI %s
 
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
-target triple = "x86_64-apple-darwin8"
-       %struct.foo = type { [4 x i64] }
+%struct.foo = type { [4 x i64] }
+
+; CHECK-LABEL: bar:
+; CHECK: movq %rdi, %rax
+
+; For the x32 ABI, pointers are 32-bit so 32-bit instructions will be used
+; X32ABI-LABEL: bar:
+; X32ABI: movl %edi, %eax
 
 define void @bar(%struct.foo* noalias sret  %agg.result, %struct.foo* %d) nounwind  {
 entry:
@@ -52,3 +59,15 @@ entry:
 return:                ; preds = %entry
        ret void
 }
+
+; CHECK-LABEL: foo:
+; CHECK: movq %rdi, %rax
+
+; For the x32 ABI, pointers are 32-bit so 32-bit instructions will be used
+; X32ABI-LABEL: foo:
+; X32ABI: movl %edi, %eax
+
+define void @foo({ i64 }* noalias nocapture sret %agg.result) nounwind {
+  store { i64 } { i64 0 }, { i64 }* %agg.result
+  ret void
+}