summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-01-31 23:45:12 +0000
committerReid Kleckner <reid@kleckner.net>2014-01-31 23:45:12 +0000
commitf10743d765c456db7c9cd2a9fe4c528d75bb5b8f (patch)
treef369c935c1a43d3cea904b1419db8aee9c0305ca /test
parent1cf770889fb526b7de5448c38c23182741be445f (diff)
downloadllvm-f10743d765c456db7c9cd2a9fe4c528d75bb5b8f.tar.gz
llvm-f10743d765c456db7c9cd2a9fe4c528d75bb5b8f.tar.bz2
llvm-f10743d765c456db7c9cd2a9fe4c528d75bb5b8f.tar.xz
Don't put non-static allocas in the static alloca map
Allocas marked inalloca are never static, but we were trying to put them into the static alloca map if they were in the entry block. Also add an assertion in x86 fastisel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200593 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/dynamic-alloca-in-entry.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/CodeGen/X86/dynamic-alloca-in-entry.ll b/test/CodeGen/X86/dynamic-alloca-in-entry.ll
new file mode 100644
index 0000000000..2ac89baaf9
--- /dev/null
+++ b/test/CodeGen/X86/dynamic-alloca-in-entry.ll
@@ -0,0 +1,19 @@
+; RUN: llc < %s -mtriple=i686-pc-win32 | FileCheck %s
+
+; Allocas with unknown size in the entry block are dynamic.
+define void @foo(i32 %n) {
+ %m = alloca i32, i32 %n
+ ret void
+}
+; CHECK-LABEL: _foo:
+; CHECK: calll __chkstk
+; CHECK: retl
+
+; Use of inalloca implies that that the alloca is not static.
+define void @bar() {
+ %m = alloca i32, inalloca
+ ret void
+}
+; CHECK-LABEL: _bar:
+; CHECK: calll __chkstk
+; CHECK: retl