From b405bbe6648d24b0cb5b03dc43c3997ac4f50a9b Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Thu, 3 Sep 2009 23:27:31 +0000 Subject: [PATCH] Replace ocamlc tests with ocamlopt tests since they're less noisy. There's a bug with ocamlc that uses "char*" instead of "const char*" for global string variables. This causes g++ to be very noisy when linking ocamlc programs. That's why the ocaml test used to cat to /dev/null. ocamlopt doesn't have this problem, so we can get rid of the >/dev/null, which may obscure some problems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80968 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Bindings/Ocaml/analysis.ml | 2 +- test/Bindings/Ocaml/bitreader.ml | 2 +- test/Bindings/Ocaml/bitwriter.ml | 2 +- test/Bindings/Ocaml/executionengine.ml | 2 +- test/Bindings/Ocaml/scalar_opts.ml | 4 ++-- test/Bindings/Ocaml/target.ml | 4 ++-- test/Bindings/Ocaml/vmcore.ml | 4 ++-- test/Makefile | 8 ++++---- test/lib/llvm.exp | 6 +++--- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/test/Bindings/Ocaml/analysis.ml b/test/Bindings/Ocaml/analysis.ml index 29ebb922474..e830106c11f 100644 --- a/test/Bindings/Ocaml/analysis.ml +++ b/test/Bindings/Ocaml/analysis.ml @@ -1,4 +1,4 @@ -(* RUN: %ocamlc -warn-error A llvm.cma llvm_analysis.cma %s -o %t 2> /dev/null +(* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_analysis.cmxa %s -o %t * RUN: ./%t %t.bc *) diff --git a/test/Bindings/Ocaml/bitreader.ml b/test/Bindings/Ocaml/bitreader.ml index 2abeda95f52..5c23041c80d 100644 --- a/test/Bindings/Ocaml/bitreader.ml +++ b/test/Bindings/Ocaml/bitreader.ml @@ -1,4 +1,4 @@ -(* RUN: %ocamlc -warn-error A llvm.cma llvm_bitreader.cma llvm_bitwriter.cma %s -o %t 2> /dev/null +(* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_bitreader.cmxa llvm_bitwriter.cmxa %s -o %t * RUN: ./%t %t.bc * RUN: llvm-dis < %t.bc | grep caml_int_ty *) diff --git a/test/Bindings/Ocaml/bitwriter.ml b/test/Bindings/Ocaml/bitwriter.ml index 42c8daec5d2..57caac7cb97 100644 --- a/test/Bindings/Ocaml/bitwriter.ml +++ b/test/Bindings/Ocaml/bitwriter.ml @@ -1,4 +1,4 @@ -(* RUN: %ocamlc -warn-error A llvm.cma llvm_bitwriter.cma %s -o %t 2> /dev/null +(* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_bitwriter.cmxa %s -o %t * RUN: ./%t %t.bc * RUN: llvm-dis < %t.bc | grep caml_int_ty *) diff --git a/test/Bindings/Ocaml/executionengine.ml b/test/Bindings/Ocaml/executionengine.ml index 420a14f67c5..ce56c50dcb6 100644 --- a/test/Bindings/Ocaml/executionengine.ml +++ b/test/Bindings/Ocaml/executionengine.ml @@ -1,4 +1,4 @@ -(* RUN: %ocamlc -warn-error A llvm.cma llvm_target.cma llvm_executionengine.cma %s -o %t 2> /dev/null +(* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_target.cmxa llvm_executionengine.cmxa %s -o %t * RUN: ./%t %t.bc *) diff --git a/test/Bindings/Ocaml/scalar_opts.ml b/test/Bindings/Ocaml/scalar_opts.ml index 8f6802da765..0a65810105b 100644 --- a/test/Bindings/Ocaml/scalar_opts.ml +++ b/test/Bindings/Ocaml/scalar_opts.ml @@ -1,7 +1,7 @@ -(* RUN: %ocamlc -warn-error A llvm.cma llvm_scalar_opts.cma llvm_target.cma %s -o %t 2> /dev/null +(* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_scalar_opts.cmxa llvm_target.cmxa %s -o %t *) -(* Note: It takes several seconds for ocamlc to link an executable with +(* Note: It takes several seconds for ocamlopt to link an executable with libLLVMCore.a, so it's better to write a big test than a bunch of little ones. *) diff --git a/test/Bindings/Ocaml/target.ml b/test/Bindings/Ocaml/target.ml index f7d1cbf2859..3c3b7339fef 100644 --- a/test/Bindings/Ocaml/target.ml +++ b/test/Bindings/Ocaml/target.ml @@ -1,7 +1,7 @@ -(* RUN: %ocamlc -warn-error A llvm.cma llvm_target.cma %s -o %t 2> /dev/null +(* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_target.cmxa %s -o %t *) -(* Note: It takes several seconds for ocamlc to link an executable with +(* Note: It takes several seconds for ocamlopt to link an executable with libLLVMCore.a, so it's better to write a big test than a bunch of little ones. *) diff --git a/test/Bindings/Ocaml/vmcore.ml b/test/Bindings/Ocaml/vmcore.ml index 4f6d3eabf25..9e976d34aa4 100644 --- a/test/Bindings/Ocaml/vmcore.ml +++ b/test/Bindings/Ocaml/vmcore.ml @@ -1,9 +1,9 @@ -(* RUN: %ocamlc -warn-error A llvm.cma llvm_analysis.cma llvm_bitwriter.cma %s -o %t 2> /dev/null +(* RUN: %ocamlopt -warn-error A llvm.cmxa llvm_analysis.cmxa llvm_bitwriter.cmxa %s -o %t * RUN: ./%t %t.bc * RUN: llvm-dis < %t.bc > %t.ll *) -(* Note: It takes several seconds for ocamlc to link an executable with +(* Note: It takes several seconds for ocamlopt to link an executable with libLLVMCore.a, so it's better to write a big test than a bunch of little ones. *) diff --git a/test/Makefile b/test/Makefile index 36b3223a89f..317d19b27c6 100644 --- a/test/Makefile +++ b/test/Makefile @@ -104,9 +104,9 @@ else BUGPOINT_TOPTS="" endif -ifneq ($(OCAMLC),) -CC_FOR_OCAMLC := $(shell $(OCAMLC) -config | grep native_c_compiler | sed -e 's/native_c_compiler: //') -CXX_FOR_OCAMLC := $(subst gcc,g++,$(CC_FOR_OCAMLC)) +ifneq ($(OCAMLOPT),) +CC_FOR_OCAMLOPT := $(shell $(OCAMLOPT) -config | grep native_c_compiler | sed -e 's/native_c_compiler: //') +CXX_FOR_OCAMLOPT := $(subst gcc,g++,$(CC_FOR_OCAMLOPT)) endif FORCE: @@ -137,7 +137,7 @@ site.exp: FORCE @echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp @echo 'set bugpoint_topts $(BUGPOINT_TOPTS)' >> site.tmp @echo 'set shlibext "$(SHLIBEXT)"' >> site.tmp - @echo 'set ocamlc "$(OCAMLC) -cc \"$(CXX_FOR_OCAMLC)\" -I $(LibDir)/ocaml"' >> site.tmp + @echo 'set ocamlopt "$(OCAMLOPT) -cc \"$(CXX_FOR_OCAMLOPT)\" -I $(LibDir)/ocaml"' >> site.tmp @echo 'set valgrind "$(VALGRIND)"' >> site.tmp @echo 'set grep "$(GREP)"' >>site.tmp @echo 'set gas "$(GAS)"' >>site.tmp diff --git a/test/lib/llvm.exp b/test/lib/llvm.exp index 3e2632f12c1..eb437588f3c 100644 --- a/test/lib/llvm.exp +++ b/test/lib/llvm.exp @@ -47,7 +47,7 @@ proc execOneLine { test PRS outcome lineno line } { # cases. proc substitute { line test tmpFile } { global srcroot objroot srcdir objdir subdir target_triplet prcontext - global llvmgcc llvmgxx llvmgcc_version llvmgccmajvers ocamlc + global llvmgcc llvmgxx llvmgcc_version llvmgccmajvers ocamlopt global gccpath gxxpath compile_c compile_cxx link shlibext llvmlibsdir global llvmdsymutil valgrind grep gas bugpoint_topts set path [file join $srcdir $subdir] @@ -71,8 +71,8 @@ proc substitute { line test tmpFile } { regsub -all {%link} $new_line "$link" new_line #replace %shlibext with shared library extension regsub -all {%shlibext} $new_line "$shlibext" new_line - #replace %ocamlc with ocaml compiler command - regsub -all {%ocamlc} $new_line "$ocamlc" new_line + #replace %ocamlopt with ocaml compiler command + regsub -all {%ocamlopt} $new_line "$ocamlopt" new_line #replace %llvmdsymutil with dsymutil command regsub -all {%llvmdsymutil} $new_line "$llvmdsymutil" new_line #replace %llvmlibsdir with configure library directory -- 2.34.1