[llvm-commits] [test-suite] r106870 - /test-suite/trunk/SingleSource/UnitTests/DefaultInitDynArrays.cpp
Fariborz Jahanian
fjahanian at apple.com
Fri Jun 25 11:29:01 PDT 2010
Author: fjahanian
Date: Fri Jun 25 13:29:00 2010
New Revision: 106870
URL: http://llvm.org/viewvc/llvm-project?rev=106870&view=rev
Log:
Test case for PR7490 (clang PR).
Added:
test-suite/trunk/SingleSource/UnitTests/DefaultInitDynArrays.cpp
Added: test-suite/trunk/SingleSource/UnitTests/DefaultInitDynArrays.cpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/DefaultInitDynArrays.cpp?rev=106870&view=auto
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/DefaultInitDynArrays.cpp (added)
+++ test-suite/trunk/SingleSource/UnitTests/DefaultInitDynArrays.cpp Fri Jun 25 13:29:00 2010
@@ -0,0 +1,20 @@
+#include <assert.h>
+
+void func() {
+ int *buckets = new int[111]();
+ for (int i = 0; i < 111; i++)
+ assert(buckets[i] == 0);
+ for (int i = 0; i < 111; i++)
+ buckets[i] = i;
+
+ delete [] buckets;
+}
+
+int main(int argc, char **argv) {
+ func();
+ func();
+ func();
+ func();
+ func();
+ return 0;
+}
More information about the llvm-commits
mailing list