aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKostis Sagonas <[email protected]>2014-04-02 23:50:40 +0200
committerKostis Sagonas <[email protected]>2015-12-16 22:08:33 +0100
commit348059f6ff735362977115d5910c1edbd3f1bc25 (patch)
tree7dc9d07590b66c7ebca0ea5b16a94821f549deac /lib
parentf3b62ad3fb0b989d58e9018cbe3b62d4d7300341 (diff)
downloadotp-348059f6ff735362977115d5910c1edbd3f1bc25.tar.gz
otp-348059f6ff735362977115d5910c1edbd3f1bc25.tar.bz2
otp-348059f6ff735362977115d5910c1edbd3f1bc25.zip
Use function from hipe module instead of a local one
Diffstat (limited to 'lib')
-rw-r--r--lib/hipe/test/hipe_testsuite_driver.erl16
1 files changed, 2 insertions, 14 deletions
diff --git a/lib/hipe/test/hipe_testsuite_driver.erl b/lib/hipe/test/hipe_testsuite_driver.erl
index 5f05a716bc..9f5d7421b4 100644
--- a/lib/hipe/test/hipe_testsuite_driver.erl
+++ b/lib/hipe/test/hipe_testsuite_driver.erl
@@ -176,7 +176,8 @@ run(TestCase, Dir, _OutDir) ->
HiPEOpts = try TestCase:hipe_options() catch error:undef -> [] end,
{ok, TestCase} = hipe:c(TestCase, HiPEOpts),
ok = TestCase:test(),
- case is_llvm_opt_available() of
+ ToLLVM = try TestCase:to_llvm() catch error:undef -> true end,
+ case ToLLVM andalso hipe:llvm_support_available() of
true ->
{ok, TestCase} = hipe:c(TestCase, [to_llvm|HiPEOpts]),
ok = TestCase:test();
@@ -186,16 +187,3 @@ run(TestCase, Dir, _OutDir) ->
%% lists:foreach(fun (DF) -> ok end, % = file:delete(DF) end,
%% [filename:join(OutDir, D) || D <- DataFiles])
%% end.
-
-
-%% This function, which is supposed to check whether the right LLVM
-%% infrastructure is available, should be probably written in a better
-%% and more portable way and moved to the hipe application.
-
-is_llvm_opt_available() ->
- OptStr = os:cmd("opt -version"),
- SubStr = "LLVM version ", N = length(SubStr),
- case string:str(OptStr, SubStr) of
- 0 -> false;
- S -> P = S + N, string:sub_string(OptStr, P, P + 2) >= "3.4"
- end.