Mercurial > hg > CbC > CbC_llvm
comparison llvm/test/Instrumentation/AddressSanitizer/global_addrspace.ll @ 150:1d019706d866
LLVM10
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 15:10:13 +0900 |
parents | |
children | 2e18cbf3894f |
comparison
equal
deleted
inserted
replaced
147:c2174574ed3a | 150:1d019706d866 |
---|---|
1 ; Only verify that asan don't crash on global variables of different | |
2 ; address space. The global variable should be unmodified by asan. | |
3 | |
4 ; RUN: opt < %s -asan -asan-module -S | FileCheck %s | |
5 | |
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" | |
8 | |
9 @a = internal addrspace(42) global [1 x i32] zeroinitializer, align 4 | |
10 | |
11 ; CHECK: @a = internal addrspace(42) global [1 x i32] zeroinitializer, align 4 | |
12 | |
13 define void @b(i32 %c) { | |
14 entry: | |
15 %conv = sext i32 %c to i64 | |
16 %0 = inttoptr i64 %conv to i32 addrspace(42)* | |
17 %cmp = icmp ugt i32 addrspace(42)* %0, getelementptr inbounds ([1 x i32], [1 x i32] addrspace(42)* @a, i64 0, i64 0) | |
18 br i1 %cmp, label %if.then, label %if.end | |
19 | |
20 if.then: | |
21 %call = tail call i32 (...) @e() | |
22 br label %if.end | |
23 | |
24 if.end: | |
25 ret void | |
26 } | |
27 | |
28 declare i32 @e(...) | |
29 | |
30 !llvm.asan.globals = !{!0} | |
31 !0 = !{[1 x i32] addrspace(42)* @a, null, !"a", i1 false, i1 false} |