[llvm] r194064 - [OCaml] (PR11717) Make declare_qualified_global respect address argument
Peter Zotov
whitequark at whitequark.org
Tue Nov 5 03:56:13 PST 2013
Author: whitequark
Date: Tue Nov 5 05:56:13 2013
New Revision: 194064
URL: http://llvm.org/viewvc/llvm-project?rev=194064&view=rev
Log:
[OCaml] (PR11717) Make declare_qualified_global respect address argument
Original patch by Jonathan Ragan-Kelley
Modified:
llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
llvm/trunk/test/Bindings/Ocaml/vmcore.ml
Modified: llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c?rev=194064&r1=194063&r2=194064&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c (original)
+++ llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c Tue Nov 5 05:56:13 2013
@@ -930,7 +930,8 @@ CAMLprim LLVMValueRef llvm_declare_quali
LLVMPointerType(Ty, Int_val(AddressSpace)));
return GlobalVar;
}
- return LLVMAddGlobal(M, Ty, String_val(Name));
+ return LLVMAddGlobalInAddressSpace(M, Ty, String_val(Name),
+ Int_val(AddressSpace));
}
/* string -> llmodule -> llvalue option */
Modified: llvm/trunk/test/Bindings/Ocaml/vmcore.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/Ocaml/vmcore.ml?rev=194064&r1=194063&r2=194064&view=diff
==============================================================================
--- llvm/trunk/test/Bindings/Ocaml/vmcore.ml (original)
+++ llvm/trunk/test/Bindings/Ocaml/vmcore.ml Tue Nov 5 05:56:13 2013
@@ -405,7 +405,8 @@ let test_global_variables () =
let fourty_two32 = const_int i32_type 42 in
group "declarations"; begin
- (* CHECK: GVar01{{.*}}external
+ (* CHECK: @GVar01 = external global i32
+ * CHECK: @QGVar01 = external addrspace(3) global i32
*)
insist (None == lookup_global "GVar01" m);
let g = declare_global i32_type "GVar01" m in
@@ -427,8 +428,10 @@ let test_global_variables () =
end;
group "definitions"; begin
- (* CHECK: GVar02{{.*}}42
- * CHECK: GVar03{{.*}}42
+ (* CHECK: @GVar02 = global i32 42
+ * CHECK: @GVar03 = global i32 42
+ * CHECK: @QGVar02 = addrspace(3) global i32 42
+ * CHECK: @QGVar03 = addrspace(3) global i32 42
*)
let g = define_global "GVar02" fourty_two32 m in
let g2 = declare_global i32_type "GVar03" m ++
More information about the llvm-commits
mailing list