brintos

brintos / llvm-project-archived public Read only

0
0
Text · 647 B · 5be21e2 Raw
18 lines · plain
1; RUN: opt < %s -passes=bounds-checking -S | FileCheck %s2target datalayout = "e-p:64:64:64-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"3 4; CHECK: @foo5define i32 @foo(i32 %i) nosanitize_bounds {6entry:7  %i.addr = alloca i32, align 48  %b = alloca [64 x i32], align 169  store i32 %i, ptr %i.addr, align 410  %0 = load i32, ptr %i.addr, align 411  %idxprom = sext i32 %0 to i6412  %arrayidx = getelementptr inbounds [64 x i32], ptr %b, i64 0, i64 %idxprom13  %1 = load i32, ptr %arrayidx, align 414  ret i32 %115; CHECK-NOT: call void @llvm.trap()16}17 18