diff graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/StaticNBodyCallTest.java @ 12697:8577cb721f51

use scoped option overriding for some HSAIL tests
author Doug Simon <doug.simon@oracle.com>
date Wed, 06 Nov 2013 18:43:45 +0100
parents 395d34c10e26
children 70b138d008ff
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/StaticNBodyCallTest.java	Wed Nov 06 16:56:05 2013 +0100
+++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/StaticNBodyCallTest.java	Wed Nov 06 18:43:45 2013 +0100
@@ -23,10 +23,15 @@
 
 package com.oracle.graal.compiler.hsail.test;
 
+import static com.oracle.graal.phases.GraalOptions.*;
 import static org.junit.Assume.*;
 
 import org.junit.*;
 
+import com.oracle.graal.options.*;
+import com.oracle.graal.options.OptionValue.OverrideScope;
+import com.oracle.graal.phases.*;
+
 /**
  * Unit test of NBody demo app. This version uses a call to the main routine which would normally be
  * too large to inline.
@@ -37,10 +42,15 @@
         StaticNBodyTest.run(inxyz, outxyz, invxyz, outvxyz, gid);
     }
 
+    public void before() {
+    }
+
     @Test
     @Override
-    public void test() {
-        assumeTrue(aggressiveInliningEnabled() || canHandleHSAILMethodCalls());
-        testGeneratedHsail();
+    public void test() throws Exception {
+        try (OverrideScope s = OptionValue.override(InlineEverything, true, getOptionFromField(GraalOptions.class, "RemoveNeverExecutedCode"), false)) {
+            assumeTrue(aggressiveInliningEnabled() || canHandleHSAILMethodCalls());
+            testGeneratedHsail();
+        }
     }
 }