llvm.org GIT mirror llvm / 150c95e
[OCaml] (PR11717) Make declare_qualified_global respect address argument Original patch by Jonathan Ragan-Kelley git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194064 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Zotov 7 years ago
2 changed file(s) with 8 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
929929 LLVMPointerType(Ty, Int_val(AddressSpace)));
930930 return GlobalVar;
931931 }
932 return LLVMAddGlobal(M, Ty, String_val(Name));
932 return LLVMAddGlobalInAddressSpace(M, Ty, String_val(Name),
933 Int_val(AddressSpace));
933934 }
934935
935936 /* string -> llmodule -> llvalue option */
404404 let fourty_two32 = const_int i32_type 42 in
405405
406406 group "declarations"; begin
407 (* CHECK: GVar01{{.*}}external
407 (* CHECK: @GVar01 = external global i32
408 * CHECK: @QGVar01 = external addrspace(3) global i32
408409 *)
409410 insist (None == lookup_global "GVar01" m);
410411 let g = declare_global i32_type "GVar01" m in
426427 end;
427428
428429 group "definitions"; begin
429 (* CHECK: GVar02{{.*}}42
430 * CHECK: GVar03{{.*}}42
430 (* CHECK: @GVar02 = global i32 42
431 * CHECK: @GVar03 = global i32 42
432 * CHECK: @QGVar02 = addrspace(3) global i32 42
433 * CHECK: @QGVar03 = addrspace(3) global i32 42
431434 *)
432435 let g = define_global "GVar02" fourty_two32 m in
433436 let g2 = declare_global i32_type "GVar03" m ++