summaryrefslogtreecommitdiff
path: root/test/CodeGen/AMDGPU/stack-size-overflow.ll
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-12-18 20:10:56 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-12-18 20:10:56 +0000
commit044eb2f6afba375a914ac9d8024f8f5142bb912e (patch)
tree1475247dc9f9fe5be155ebd4c9069c75aadf8c20 /test/CodeGen/AMDGPU/stack-size-overflow.ll
parenteb70dddbd77e120e5d490bd8fbe7ff3f8fa81c6b (diff)
Notes
Diffstat (limited to 'test/CodeGen/AMDGPU/stack-size-overflow.ll')
-rw-r--r--test/CodeGen/AMDGPU/stack-size-overflow.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/AMDGPU/stack-size-overflow.ll b/test/CodeGen/AMDGPU/stack-size-overflow.ll
new file mode 100644
index 000000000000..45a399b058cc
--- /dev/null
+++ b/test/CodeGen/AMDGPU/stack-size-overflow.ll
@@ -0,0 +1,14 @@
+; RUN: not llc -march=amdgcn < %s 2>&1 | FileCheck -check-prefix=ERROR %s
+; RUN: not llc -march=amdgcn < %s | FileCheck -check-prefix=GCN %s
+
+declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) #1
+
+; ERROR: error: stack size limit exceeded (4294967296) in stack_size_limit
+; GCN: ; ScratchSize: 4294967296
+define amdgpu_kernel void @stack_size_limit() #0 {
+entry:
+ %alloca = alloca [1073741823 x i32], align 4
+ %bc = bitcast [1073741823 x i32]* %alloca to i8*
+ call void @llvm.memset.p0i8.i32(i8* %bc, i8 9, i32 1073741823, i32 1, i1 true)
+ ret void
+}