Index: lucene/core/src/test/org/apache/lucene/index/Test2GBDocValues.java
===================================================================
--- lucene/core/src/test/org/apache/lucene/index/Test2GBDocValues.java	(revision 0)
+++ lucene/core/src/test/org/apache/lucene/index/Test2GBDocValues.java	(working copy)
@@ -0,0 +1,74 @@
+package org.apache.lucene.index;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.lucene.analysis.MockAnalyzer;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
+import org.apache.lucene.document.PackedLongDocValuesField;
+import org.apache.lucene.store.MMapDirectory;
+import org.apache.lucene.store.MockDirectoryWrapper;
+import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.TimeUnits;
+import org.apache.lucene.util._TestUtil;
+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
+
+import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;
+
+@SuppressCodecs({ "SimpleText" })
+@TimeoutSuite(millis = 4 * TimeUnits.HOUR)
+public class Test2GBDocValues extends LuceneTestCase {
+
+  @Nightly
+  public void test() throws Exception {
+    MockDirectoryWrapper dir = new MockDirectoryWrapper(random(), new MMapDirectory(_TestUtil.getTempDir("4GBDocValues")));
+    dir.setThrottling(MockDirectoryWrapper.Throttling.NEVER);
+
+    IndexWriter w = new IndexWriter(dir,
+        new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()))
+        .setMaxBufferedDocs(IndexWriterConfig.DISABLE_AUTO_FLUSH)
+        .setRAMBufferSizeMB(256.0)
+        .setMergeScheduler(new ConcurrentMergeScheduler())
+        .setMergePolicy(newLogMergePolicy(false, 10))
+        .setOpenMode(IndexWriterConfig.OpenMode.CREATE));
+
+    MergePolicy mp = w.getConfig().getMergePolicy();
+    if (mp instanceof LogByteSizeMergePolicy) {
+     // 1 petabyte:
+     ((LogByteSizeMergePolicy) mp).setMaxMergeMB(1024*1024*1024);
+    }
+
+    final Document doc = new Document();
+    final Field field = new PackedLongDocValuesField("foo", 0);
+    doc.add(field);
+
+    final int numDocs = 500000000;
+    for (int i = 0; i < numDocs; ++i) {
+      if (i == 0) {
+        field.setLongValue(0L); // force > 32bit deltas
+      } else {
+        field.setLongValue(1<<33L); 
+      }
+      w.addDocument(doc);
+    }
+    w.forceMerge(1);
+    w.close();
+    dir.close(); // checkindex
+  }
+
+}

Property changes on: lucene/core/src/test/org/apache/lucene/index/Test2GBDocValues.java
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
