src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HsErrLogTest.java
changeset 58299 6df94ce3ab2f
parent 55509 d58442b8abc1
child 58679 9c3209ff7550
equal deleted inserted replaced
58298:0152ad7b38b8 58299:6df94ce3ab2f
     1 /*
     1 /*
     2  * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    55     @Test
    55     @Test
    56     public void test1() throws IOException, InterruptedException {
    56     public void test1() throws IOException, InterruptedException {
    57         List<String> args = new ArrayList<>();
    57         List<String> args = new ArrayList<>();
    58         if (JavaVersionUtil.JAVA_SPEC <= 8) {
    58         if (JavaVersionUtil.JAVA_SPEC <= 8) {
    59             args.add("-XX:-UseJVMCIClassLoader");
    59             args.add("-XX:-UseJVMCIClassLoader");
       
    60         } else {
       
    61             args.add("--add-exports=jdk.internal.vm.compiler/org.graalvm.compiler.api.directives=ALL-UNNAMED");
    60         }
    62         }
    61         args.add("-XX:+UseJVMCICompiler");
    63         args.add("-XX:+UseJVMCICompiler");
    62         args.add("-XX:CompileOnly=" + Crasher.class.getName() + "::tryCrash");
    64         args.add("-XX:CompileOnly=" + Crasher.class.getName() + "::tryCrash");
    63         args.add(Crasher.class.getName());
    65         args.add(Crasher.class.getName());
    64         testHelper(args);
    66         testHelper(args);
    88                 checkHsErr(path);
    90                 checkHsErr(path);
    89                 return;
    91                 return;
    90             }
    92             }
    91         }
    93         }
    92 
    94 
    93         Assert.fail("Could not find " + re.pattern());
    95         Assert.fail(String.format("Could not find %s%n%s", re.pattern(), proc));
    94     }
    96     }
    95 
    97 
    96     private static void checkHsErr(File hsErrPath) {
    98     private static void checkHsErr(File hsErrPath) {
    97         try (BufferedReader br = new BufferedReader(new FileReader(hsErrPath))) {
    99         try (BufferedReader br = new BufferedReader(new FileReader(hsErrPath))) {
    98             String line = br.readLine();
   100             String line = br.readLine();