summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/stack-probe-red-zone.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/X86/stack-probe-red-zone.ll')
-rw-r--r--test/CodeGen/X86/stack-probe-red-zone.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/CodeGen/X86/stack-probe-red-zone.ll b/test/CodeGen/X86/stack-probe-red-zone.ll
new file mode 100644
index 0000000000000..f0691980989b3
--- /dev/null
+++ b/test/CodeGen/X86/stack-probe-red-zone.ll
@@ -0,0 +1,21 @@
+; RUN: llc -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck %s
+
+; Ensure that red zone usage occurs.
+define void @testStackProbesOff() {
+ %array = alloca [40096 x i8], align 16
+ ret void
+
+; CHECK-LABEL: testStackProbesOff:
+; CHECK: subq $39976, %rsp # imm = 0x9C28
+}
+
+; Ensure stack probes do not result in red zone usage.
+define void @testStackProbesOn() "probe-stack"="__probestack" {
+ %array = alloca [40096 x i8], align 16
+ ret void
+
+; CHECK-LABEL: testStackProbesOn:
+; CHECK: movl $40104, %eax # imm = 0x9CA8
+; CHECK-NEXT: callq __probestack
+; CHECK-NEXT: subq %rax, %rsp
+}