001/*
002 * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation.
008 *
009 * This code is distributed in the hope that it will be useful, but WITHOUT
010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
011 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
012 * version 2 for more details (a copy is included in the LICENSE file that
013 * accompanied this code).
014 *
015 * You should have received a copy of the GNU General Public License version
016 * 2 along with this work; if not, write to the Free Software Foundation,
017 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
018 *
019 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
020 * or visit www.oracle.com if you need additional information or have any
021 * questions.
022 */
023package com.oracle.graal.jtt.micro;
024
025import org.junit.*;
026
027import com.oracle.graal.jtt.*;
028
029/*
030 */
031public class ReferenceMap01 extends JTTTest {
032
033    public static Integer val1 = new Integer(3);
034    public static Integer val2 = new Integer(4);
035
036    @SuppressWarnings("unused")
037    private static String foo(String[] a) {
038        String[] args = new String[]{"78"};
039        Integer i1 = new Integer(1);
040        Integer i2 = new Integer(2);
041        Integer i3 = val1;
042        Integer i4 = val2;
043        Integer i5 = new Integer(5);
044        Integer i6 = new Integer(6);
045        Integer i7 = new Integer(7);
046        Integer i8 = new Integer(8);
047        Integer i9 = new Integer(9);
048        Integer i10 = new Integer(10);
049        Integer i11 = new Integer(11);
050        Integer i12 = new Integer(12);
051
052        System.gc();
053        int sum = i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12;
054        return args[0] + sum;
055    }
056
057    public static int test() {
058        return Integer.valueOf(foo(new String[]{"asdf"}));
059    }
060
061    @Test
062    public void run0() throws Throwable {
063        runTest("test");
064    }
065
066}