brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 60ef107 Raw
56 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --check-globals all --version 52; This test checks in the second run, function is not instrumented again.3; RUN: opt < %s -passes=asan,asan -S | FileCheck %s4 5target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"6target triple = "x86_64-unknown-linux-gnu"7 8; Function with sanitize_address is instrumented.9; Function Attrs: nounwind uwtable10;.11; CHECK: @___asan_globals_registered = common hidden global i64 012; CHECK: @__start_asan_globals = extern_weak hidden global i6413; CHECK: @__stop_asan_globals = extern_weak hidden global i6414;.15define void @instr_sa(ptr %a) sanitize_address {16; CHECK: Function Attrs: sanitize_address17; CHECK-LABEL: define void @instr_sa(18; CHECK-SAME: ptr [[A:%.*]]) #[[ATTR0:[0-9]+]] {19; CHECK-NEXT:  [[ENTRY:.*:]]20; CHECK-NEXT:    [[TMP0:%.*]] = ptrtoint ptr [[A]] to i6421; CHECK-NEXT:    [[TMP1:%.*]] = lshr i64 [[TMP0]], 322; CHECK-NEXT:    [[TMP2:%.*]] = add i64 [[TMP1]], 214745088023; CHECK-NEXT:    [[TMP3:%.*]] = inttoptr i64 [[TMP2]] to ptr24; CHECK-NEXT:    [[TMP4:%.*]] = load i8, ptr [[TMP3]], align 125; CHECK-NEXT:    [[TMP5:%.*]] = icmp ne i8 [[TMP4]], 026; CHECK-NEXT:    br i1 [[TMP5]], label %[[BB6:.*]], label %[[BB12:.*]], !prof [[PROF1:![0-9]+]]27; CHECK:       [[BB6]]:28; CHECK-NEXT:    [[TMP7:%.*]] = and i64 [[TMP0]], 729; CHECK-NEXT:    [[TMP8:%.*]] = add i64 [[TMP7]], 330; CHECK-NEXT:    [[TMP9:%.*]] = trunc i64 [[TMP8]] to i831; CHECK-NEXT:    [[TMP10:%.*]] = icmp sge i8 [[TMP9]], [[TMP4]]32; CHECK-NEXT:    br i1 [[TMP10]], label %[[BB11:.*]], label %[[BB12]]33; CHECK:       [[BB11]]:34; CHECK-NEXT:    call void @__asan_report_load4(i64 [[TMP0]]) #[[ATTR2:[0-9]+]]35; CHECK-NEXT:    unreachable36; CHECK:       [[BB12]]:37; CHECK-NEXT:    [[TMP1:%.*]] = load i32, ptr [[A]], align 438; CHECK-NEXT:    [[TMP2:%.*]] = add i32 [[TMP1]], 139; CHECK-NEXT:    store i32 [[TMP2]], ptr [[A]], align 440; CHECK-NEXT:    ret void41;42entry:43  %tmp1 = load i32, ptr %a, align 444  %tmp2 = add i32 %tmp1,  145  store i32 %tmp2, ptr %a, align 446  ret void47}48;.49; CHECK: attributes #[[ATTR0]] = { sanitize_address }50; CHECK: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }51; CHECK: attributes #[[ATTR2]] = { nomerge }52;.53; CHECK: [[META0:![0-9]+]] = !{i32 4, !"nosanitize_address", i32 1}54; CHECK: [[PROF1]] = !{!"branch_weights", i32 1, i32 1048575}55;.56