Files
TheRock/compiler/amd-llvm/llvm/test/Instrumentation/AddressSanitizer/asan-optimize-callbacks.ll
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

68 lines
3.2 KiB
LLVM

; RUN: opt < %s -passes=asan -asan-instrumentation-with-call-threshold=0 -asan-optimize-callbacks -S | FileCheck %s --check-prefixes=LOAD,STORE
; RUN: opt < %s -passes=asan -asan-instrumentation-with-call-threshold=0 -asan-optimize-callbacks --asan-kernel -S | FileCheck %s --check-prefixes=LOAD-KERNEL,STORE-KERNEL
target triple = "x86_64-unknown-linux-gnu"
define void @load(ptr %p1, ptr %p2, ptr %p4, ptr %p8, ptr %p16)
sanitize_address {
%n1 = load i8, ptr %p1, align 1
%n2 = load i16, ptr %p2, align 2
%n4 = load i32, ptr %p4, align 4
%n8 = load i64, ptr %p8, align 8
%n16 = load i128, ptr %p16, align 16
; LOAD: call void @llvm.asan.check.memaccess(ptr %p1, i32 0)
; LOAD-NEXT: %n1 = load i8, ptr %p1, align 1
; LOAD-NEXT: call void @llvm.asan.check.memaccess(ptr %p2, i32 2)
; LOAD-NEXT: %n2 = load i16, ptr %p2, align 2
; LOAD-NEXT: call void @llvm.asan.check.memaccess(ptr %p4, i32 4)
; LOAD-NEXT: %n4 = load i32, ptr %p4, align 4
; LOAD-NEXT: call void @llvm.asan.check.memaccess(ptr %p8, i32 6)
; LOAD-NEXT: %n8 = load i64, ptr %p8, align 8
; LOAD-NEXT: call void @llvm.asan.check.memaccess(ptr %p16, i32 8)
; LOAD-NEXT: %n16 = load i128, ptr %p16, align 16
; LOAD-KERNEL: call void @llvm.asan.check.memaccess(ptr %p1, i32 1)
; LOAD-KERNEL-NEXT: %n1 = load i8, ptr %p1, align 1
; LOAD-KERNEL-NEXT: call void @llvm.asan.check.memaccess(ptr %p2, i32 3)
; LOAD-KERNEL-NEXT: %n2 = load i16, ptr %p2, align 2
; LOAD-KERNEL-NEXT: call void @llvm.asan.check.memaccess(ptr %p4, i32 5)
; LOAD-KERNEL-NEXT: %n4 = load i32, ptr %p4, align 4
; LOAD-KERNEL-NEXT: call void @llvm.asan.check.memaccess(ptr %p8, i32 7)
; LOAD-KERNEL-NEXT: %n8 = load i64, ptr %p8, align 8
; LOAD-KERNEL-NEXT: call void @llvm.asan.check.memaccess(ptr %p16, i32 9)
; LOAD-KERNEL-NEXT: %n16 = load i128, ptr %p16, align 16
ret void
}
define void @store(ptr %p1, ptr %p2, ptr %p4, ptr %p8, ptr %p16)
sanitize_address {
store i8 0, ptr %p1, align 1
store i16 0, ptr %p2, align 2
store i32 0, ptr %p4, align 4
store i64 0, ptr %p8, align 8
store i128 0, ptr %p16, align 16
; STORE: call void @llvm.asan.check.memaccess(ptr %p1, i32 32)
; STORE-NEXT: store i8 0, ptr %p1, align 1
; STORE-NEXT: call void @llvm.asan.check.memaccess(ptr %p2, i32 34)
; STORE-NEXT: store i16 0, ptr %p2, align 2
; STORE-NEXT: call void @llvm.asan.check.memaccess(ptr %p4, i32 36)
; STORE-NEXT: store i32 0, ptr %p4, align 4
; STORE-NEXT: call void @llvm.asan.check.memaccess(ptr %p8, i32 38)
; STORE-NEXT: store i64 0, ptr %p8, align 8
; STORE-NEXT: call void @llvm.asan.check.memaccess(ptr %p16, i32 40)
; STORE-NEXT: store i128 0, ptr %p16, align 16
; STORE-KERNEL: call void @llvm.asan.check.memaccess(ptr %p1, i32 33)
; STORE-KERNEL-NEXT: store i8 0, ptr %p1, align 1
; STORE-KERNEL-NEXT: call void @llvm.asan.check.memaccess(ptr %p2, i32 35)
; STORE-KERNEL-NEXT: store i16 0, ptr %p2, align 2
; STORE-KERNEL-NEXT: call void @llvm.asan.check.memaccess(ptr %p4, i32 37)
; STORE-KERNEL-NEXT: store i32 0, ptr %p4, align 4
; STORE-KERNEL-NEXT: call void @llvm.asan.check.memaccess(ptr %p8, i32 39)
; STORE-KERNEL-NEXT: store i64 0, ptr %p8, align 8
; STORE-KERNEL-NEXT: call void @llvm.asan.check.memaccess(ptr %p16, i32 41)
; STORE-KERNEL-NEXT: store i128 0, ptr %p16, align 16
; STORE-KERNEL-NEXT: ret void
ret void
}