This commit was manufactured by cvs2svn to create branch 'release_13'.
llvm-svn: 15683
diff --git a/SingleSource/Regression/C/2004-08-12-InlinerAndAllocas.c b/SingleSource/Regression/C/2004-08-12-InlinerAndAllocas.c
new file mode 100644
index 0000000..4a730c8
--- /dev/null
+++ b/SingleSource/Regression/C/2004-08-12-InlinerAndAllocas.c
@@ -0,0 +1,21 @@
+// A compiler cannot inline Callee into main unless it is prepared to reclaim
+// the stack memory allocated in it.
+
+#include <alloca.h>
+#include <stdio.h>
+
+static int Callee(int i) {
+ if (i != 0) {
+ char *X = alloca(1000);
+ sprintf(X, "%d\n", i);
+ return X[0];
+ }
+ return 0;
+}
+
+int main() {
+ int i, j = 0;
+ for (i = 0; i < 10000; ++i)
+ j += Callee(i);
+ printf("%d\n", j);
+}