brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · b2eaa31 Raw
68 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 52; RUN: llc -filetype asm -o - %s | FileCheck %s3 4; This shows that CodeGen for AArch64 will elide the tag check when lowering5; the HWASan memaccess intrinsic for null pointers.6;7; N.B. The HWASan pass will normally omit the memaccess intrinsic if the8;      pointer is already statically known to be null.9;10; The source was generated from llvm/test/Instrumentation/HWAddressSanitizer/zero-ptr.ll11; with the memaccess deliberately retained.12 13; ModuleID = '<stdin>'14source_filename = "<stdin>"15target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"16target triple = "aarch64--linux-android10000"17 18$hwasan.module_ctor = comdat any19 20@__start_hwasan_globals = external hidden constant [0 x i8]21@__stop_hwasan_globals = external hidden constant [0 x i8]22@hwasan.note = private constant { i32, i32, i32, [8 x i8], i32, i32 } { i32 8, i32 8, i32 3, [8 x i8] c"LLVM\00\00\00\00", i32 trunc (i64 sub (i64 ptrtoint (ptr @__start_hwasan_globals to i64), i64 ptrtoint (ptr @hwasan.note to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @__stop_hwasan_globals to i64), i64 ptrtoint (ptr @hwasan.note to i64)) to i32) }, section ".note.hwasan.globals", comdat($hwasan.module_ctor), align 423 24; Function Attrs: sanitize_hwaddress25define void @test_store_to_zeroptr() #0 {26; CHECK-LABEL: test_store_to_zeroptr:27; CHECK:       // %bb.0: // %entry28; CHECK-NEXT:    str x30, [sp, #-16]! // 8-byte Folded Spill29; CHECK-NEXT:    .cfi_def_cfa_offset 1630; CHECK-NEXT:    .cfi_offset w30, -1631; CHECK-NEXT:    mov x8, xzr32; CHECK-NEXT:    mov w9, #42 // =0x2a33; CHECK-NEXT:    str x9, [x8]34; CHECK-NEXT:    ldr x30, [sp], #16 // 8-byte Folded Reload35; CHECK-NEXT:    ret36entry:37  %.hwasan.shadow = call ptr asm "", "=r,0"(ptr null)38  %b = inttoptr i64 0 to ptr39  call void @llvm.hwasan.check.memaccess.shortgranules.fixedshadow(ptr %b, i32 19, i64 0)40  store i64 42, ptr %b, align 841  ret void42}43 44; Function Attrs: nounwind45declare void @llvm.hwasan.check.memaccess.shortgranules.fixedshadow(ptr, i32 immarg, i64 immarg) #146 47attributes #0 = { sanitize_hwaddress }48attributes #1 = { nounwind }49 50declare void @__hwasan_init()51 52; Function Attrs: nounwind53define internal void @hwasan.module_ctor() #1 comdat {54; CHECK-LABEL: hwasan.module_ctor:55; CHECK:       // %bb.0:56; CHECK-NEXT:    str x30, [sp, #-16]! // 8-byte Folded Spill57; CHECK-NEXT:    bl __hwasan_init58; CHECK-NEXT:    ldr x30, [sp], #16 // 8-byte Folded Reload59; CHECK-NEXT:    ret60  call void @__hwasan_init()61  ret void62}63 64!llvm.module.flags = !{!1}65 66!0 = !{ptr @hwasan.note}67!1 = !{i32 4, !"nosanitize_hwaddress", i32 1}68