1 ; Only verify that asan don't crash on global variables of different
2 ; address space. The global variable should be unmodified by asan.
4 ; RUN: opt < %s -passes=asan -S | FileCheck %s
6 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
7 target triple = "x86_64-unknown-linux-gnu"
9 @a = internal addrspace(42) global [1 x i32] zeroinitializer, align 4
11 ; CHECK: @a = internal addrspace(42) global [1 x i32] zeroinitializer, align 4
13 define void @b(i32 %c) {
15 %conv = sext i32 %c to i64
16 %0 = inttoptr i64 %conv to ptr addrspace(42)
17 %cmp = icmp ugt ptr addrspace(42) %0, @a
18 br i1 %cmp, label %if.then, label %if.end
21 %call = tail call i32 (...) @e()
30 !llvm.asan.globals = !{!0}
31 !0 = !{ptr addrspace(42) @a, null, !"a", i1 false, i1 false}