File: memaccess-clobber.ll

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (23 lines) | stat: -rw-r--r-- 815 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
; Make sure memaccess checks preceed the following reads.
;
; RUN: opt < %s -disable-output 2>&1 -passes='hwasan,print<memoryssa>' -hwasan-use-stack-safety=0 -mtriple aarch64-linux-android30 | FileCheck %s

target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64--linux-android10000"

declare void @use32(i32*)

define i32 @test_alloca() sanitize_hwaddress {
entry:
  %x = alloca i32, align 4
  ; CHECK: call void @use32
  call void @use32(i32* nonnull %x)
  ; CHECK: [[A:[0-9]+]] = MemoryDef({{[0-9]+}})
  ; CHECK-NEXT: call void @llvm.hwasan.check.memaccess.shortgranules
  ; CHECK: MemoryUse([[A]])
  ; CHECK-NEXT: load i32, i32* %x.hwasan
  %y = load i32, i32* %x
  ; CHECK: {{[0-9]+}} = MemoryDef([[A]])
  ; CHECK-NEXT: call void @llvm.memset.p0i8.i64
  ret i32 %y
}