1 ; RUN: opt -S -passes=asan < %s | FileCheck %s
3 ; Check behavior with a non-0 default program address space. The
4 ; constructor should be in addrspace(1) and the global_ctors should
7 ; CHECK: @a = internal addrspace(42) global [1 x i32] zeroinitializer, align 4
8 ; CHECK: @llvm.used = appending global [1 x ptr] [ptr addrspacecast (ptr addrspace(1) @asan.module_ctor to ptr)], section "llvm.metadata"
9 ; CHECK: @llvm.global_ctors = appending global [1 x { i32, ptr addrspace(1), ptr }] [{ i32, ptr addrspace(1), ptr } { i32 1, ptr addrspace(1) @asan.module_ctor, ptr addrspacecast (ptr addrspace(1) @asan.module_ctor to ptr) }]
11 ; CHECK: define internal void @asan.module_ctor() addrspace(1) #0 comdat {
13 target datalayout = "P1"
15 @a = internal addrspace(42) global [1 x i32] zeroinitializer, align 4
17 define i1 @b(i64 %c) addrspace(1) {
18 %cast = inttoptr i64 %c to ptr addrspace(42)
19 %cmp = icmp ugt ptr addrspace(42) %cast, @a
23 !llvm.asan.globals = !{!0}
24 !0 = !{ptr addrspace(42) @a, null, !"a", i1 false, i1 false}