6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @enablePreview
27 * @run testng TestMemoryDereference
28 */
29
30 import java.lang.foreign.MemorySegment;
31
32 import java.nio.ByteBuffer;
33 import java.nio.ByteOrder;
34
35 import java.lang.foreign.ValueLayout;
36 import org.testng.annotations.*;
37
38 import static java.lang.foreign.ValueLayout.*;
39 import static org.testng.Assert.*;
40
41 public class TestMemoryDereference {
42
43 static class Accessor<X> {
44
45 interface SegmentGetter<X> {
46 X get(MemorySegment segment);
|
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @run testng TestMemoryDereference
27 */
28
29 import java.lang.foreign.MemorySegment;
30
31 import java.nio.ByteBuffer;
32 import java.nio.ByteOrder;
33
34 import java.lang.foreign.ValueLayout;
35 import org.testng.annotations.*;
36
37 import static java.lang.foreign.ValueLayout.*;
38 import static org.testng.Assert.*;
39
40 public class TestMemoryDereference {
41
42 static class Accessor<X> {
43
44 interface SegmentGetter<X> {
45 X get(MemorySegment segment);
|