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
368 lines
17 KiB
LLVM
368 lines
17 KiB
LLVM
; RUN: opt -mtriple=x86_64-pc-linux-gnu -aa-pipeline=basic-aa -passes=inferattrs,aa-eval -print-all-alias-modref-info -disable-output 2>&1 %s | FileCheck %s
|
|
|
|
; CHECK-LABEL: Function: test_memcmp_const_size
|
|
; CHECK: Just Ref: Ptr: i8* %a <-> %res = tail call i32 @memcmp(ptr %a, ptr %b, i64 4)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b <-> %res = tail call i32 @memcmp(ptr %a, ptr %b, i64 4)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %a.gep.1 <-> %res = tail call i32 @memcmp(ptr %a, ptr %b, i64 4)
|
|
; CHECK-NEXT: NoModRef: Ptr: i8* %a.gep.5 <-> %res = tail call i32 @memcmp(ptr %a, ptr %b, i64 4)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.1 <-> %res = tail call i32 @memcmp(ptr %a, ptr %b, i64 4)
|
|
; CHECK-NEXT: NoModRef: Ptr: i8* %b.gep.5 <-> %res = tail call i32 @memcmp(ptr %a, ptr %b, i64 4)
|
|
define i32 @test_memcmp_const_size(ptr noalias %a, ptr noalias %b) {
|
|
entry:
|
|
load i8, ptr %a
|
|
load i8, ptr %b
|
|
%res = tail call i32 @memcmp(ptr %a, ptr %b, i64 4)
|
|
%a.gep.1 = getelementptr i8, ptr %a, i32 1
|
|
store i8 0, ptr %a.gep.1
|
|
%a.gep.5 = getelementptr i8, ptr %a, i32 5
|
|
store i8 1, ptr %a.gep.5
|
|
%b.gep.1 = getelementptr i8, ptr %b, i32 1
|
|
store i8 2, ptr %b.gep.1
|
|
%b.gep.5 = getelementptr i8, ptr %b, i32 5
|
|
store i8 3, ptr %b.gep.5
|
|
ret i32 %res
|
|
}
|
|
|
|
; CHECK-LABEL: Function: test_memcmp_variable_size
|
|
; CHECK: Just Ref: Ptr: i8* %a <-> %res = tail call i32 @memcmp(ptr %a, ptr %b, i64 %n)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b <-> %res = tail call i32 @memcmp(ptr %a, ptr %b, i64 %n)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %a.gep.1 <-> %res = tail call i32 @memcmp(ptr %a, ptr %b, i64 %n)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %a.gep.5 <-> %res = tail call i32 @memcmp(ptr %a, ptr %b, i64 %n)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.1 <-> %res = tail call i32 @memcmp(ptr %a, ptr %b, i64 %n)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.5 <-> %res = tail call i32 @memcmp(ptr %a, ptr %b, i64 %n)
|
|
define i32 @test_memcmp_variable_size(ptr noalias %a, ptr noalias %b, i64 %n) {
|
|
entry:
|
|
load i8, ptr %a
|
|
load i8, ptr %b
|
|
%res = tail call i32 @memcmp(ptr %a, ptr %b, i64 %n)
|
|
%a.gep.1 = getelementptr i8, ptr %a, i32 1
|
|
store i8 0, ptr %a.gep.1
|
|
%a.gep.5 = getelementptr i8, ptr %a, i32 5
|
|
store i8 1, ptr %a.gep.5
|
|
%b.gep.1 = getelementptr i8, ptr %b, i32 1
|
|
store i8 2, ptr %b.gep.1
|
|
%b.gep.5 = getelementptr i8, ptr %b, i32 5
|
|
store i8 3, ptr %b.gep.5
|
|
ret i32 %res
|
|
}
|
|
|
|
declare i32 @memcmp(ptr, ptr, i64)
|
|
declare i32 @bcmp(ptr, ptr, i64)
|
|
|
|
; CHECK-LABEL: Function: test_bcmp_const_size
|
|
; CHECK: Just Ref: Ptr: i8* %a <-> %res = tail call i32 @bcmp(ptr %a, ptr %b, i64 4)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b <-> %res = tail call i32 @bcmp(ptr %a, ptr %b, i64 4)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %a.gep.1 <-> %res = tail call i32 @bcmp(ptr %a, ptr %b, i64 4)
|
|
; CHECK-NEXT: NoModRef: Ptr: i8* %a.gep.5 <-> %res = tail call i32 @bcmp(ptr %a, ptr %b, i64 4)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.1 <-> %res = tail call i32 @bcmp(ptr %a, ptr %b, i64 4)
|
|
; CHECK-NEXT: NoModRef: Ptr: i8* %b.gep.5 <-> %res = tail call i32 @bcmp(ptr %a, ptr %b, i64 4)
|
|
define i32 @test_bcmp_const_size(ptr noalias %a, ptr noalias %b) {
|
|
entry:
|
|
load i8, ptr %a
|
|
load i8, ptr %b
|
|
%res = tail call i32 @bcmp(ptr %a, ptr %b, i64 4)
|
|
%a.gep.1 = getelementptr i8, ptr %a, i32 1
|
|
store i8 0, ptr %a.gep.1
|
|
%a.gep.5 = getelementptr i8, ptr %a, i32 5
|
|
store i8 1, ptr %a.gep.5
|
|
%b.gep.1 = getelementptr i8, ptr %b, i32 1
|
|
store i8 2, ptr %b.gep.1
|
|
%b.gep.5 = getelementptr i8, ptr %b, i32 5
|
|
store i8 3, ptr %b.gep.5
|
|
ret i32 %res
|
|
}
|
|
|
|
; CHECK-LABEL: Function: test_bcmp_variable_size
|
|
; CHECK: Just Ref: Ptr: i8* %a <-> %res = tail call i32 @bcmp(ptr %a, ptr %b, i64 %n)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b <-> %res = tail call i32 @bcmp(ptr %a, ptr %b, i64 %n)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %a.gep.1 <-> %res = tail call i32 @bcmp(ptr %a, ptr %b, i64 %n)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %a.gep.5 <-> %res = tail call i32 @bcmp(ptr %a, ptr %b, i64 %n)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.1 <-> %res = tail call i32 @bcmp(ptr %a, ptr %b, i64 %n)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.5 <-> %res = tail call i32 @bcmp(ptr %a, ptr %b, i64 %n)
|
|
define i32 @test_bcmp_variable_size(ptr noalias %a, ptr noalias %b, i64 %n) {
|
|
entry:
|
|
load i8, ptr %a
|
|
load i8, ptr %b
|
|
%res = tail call i32 @bcmp(ptr %a, ptr %b, i64 %n)
|
|
%a.gep.1 = getelementptr i8, ptr %a, i32 1
|
|
store i8 0, ptr %a.gep.1
|
|
%a.gep.5 = getelementptr i8, ptr %a, i32 5
|
|
store i8 1, ptr %a.gep.5
|
|
%b.gep.1 = getelementptr i8, ptr %b, i32 1
|
|
store i8 2, ptr %b.gep.1
|
|
%b.gep.5 = getelementptr i8, ptr %b, i32 5
|
|
store i8 3, ptr %b.gep.5
|
|
ret i32 %res
|
|
}
|
|
|
|
declare ptr @memchr(ptr, i32, i64)
|
|
|
|
; CHECK-LABEL: Function: test_memchr_const_size
|
|
; CHECK: Just Ref: Ptr: i8* %res <-> %res = call ptr @memchr(ptr %a, i32 42, i64 4)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %a.gep.1 <-> %res = call ptr @memchr(ptr %a, i32 42, i64 4)
|
|
; CHECK-NEXT: NoModRef: Ptr: i8* %a.gep.5 <-> %res = call ptr @memchr(ptr %a, i32 42, i64 4)
|
|
define ptr @test_memchr_const_size(ptr noalias %a) {
|
|
entry:
|
|
%res = call ptr @memchr(ptr %a, i32 42, i64 4)
|
|
load i8, ptr %res
|
|
%a.gep.1 = getelementptr i8, ptr %a, i32 1
|
|
store i8 0, ptr %a.gep.1
|
|
%a.gep.5 = getelementptr i8, ptr %a, i32 5
|
|
store i8 1, ptr %a.gep.5
|
|
ret ptr %res
|
|
}
|
|
|
|
declare ptr @memccpy(ptr, ptr, i32, i64)
|
|
|
|
; CHECK-LABEL: Function: test_memccpy_const_size
|
|
; CHECK: Just Mod: Ptr: i8* %a <-> %res = call ptr @memccpy(ptr %a, ptr %b, i32 42, i64 4)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b <-> %res = call ptr @memccpy(ptr %a, ptr %b, i32 42, i64 4)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %res <-> %res = call ptr @memccpy(ptr %a, ptr %b, i32 42, i64 4)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> %res = call ptr @memccpy(ptr %a, ptr %b, i32 42, i64 4)
|
|
; CHECK-NEXT: NoModRef: Ptr: i8* %a.gep.5 <-> %res = call ptr @memccpy(ptr %a, ptr %b, i32 42, i64 4)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.1 <-> %res = call ptr @memccpy(ptr %a, ptr %b, i32 42, i64 4)
|
|
; CHECK-NEXT: NoModRef: Ptr: i8* %b.gep.5 <-> %res = call ptr @memccpy(ptr %a, ptr %b, i32 42, i64 4)
|
|
|
|
define ptr @test_memccpy_const_size(ptr noalias %a, ptr noalias %b) {
|
|
entry:
|
|
load i8, ptr %a
|
|
load i8, ptr %b
|
|
%res = call ptr @memccpy(ptr %a, ptr %b, i32 42, i64 4)
|
|
load i8, ptr %res
|
|
%a.gep.1 = getelementptr i8, ptr %a, i32 1
|
|
store i8 0, ptr %a.gep.1
|
|
%a.gep.5 = getelementptr i8, ptr %a, i32 5
|
|
store i8 1, ptr %a.gep.5
|
|
%b.gep.1 = getelementptr i8, ptr %b, i32 1
|
|
store i8 2, ptr %b.gep.1
|
|
%b.gep.5 = getelementptr i8, ptr %b, i32 5
|
|
store i8 3, ptr %b.gep.5
|
|
ret ptr %res
|
|
}
|
|
|
|
declare ptr @strcat(ptr, ptr)
|
|
|
|
define ptr @test_strcat_read_write_after(ptr noalias %a, ptr noalias %b) {
|
|
; CHECK-LABEL: Function: test_strcat_read_write_after
|
|
; CHECK: NoModRef: Ptr: i8* %a <-> %res = tail call ptr @strcat(ptr %a.gep.1, ptr %b.gep.1)
|
|
; CHECK-NEXT: NoModRef: Ptr: i8* %b <-> %res = tail call ptr @strcat(ptr %a.gep.1, ptr %b.gep.1)
|
|
; CHECK-NEXT: Both ModRef: Ptr: i8* %a.gep.1 <-> %res = tail call ptr @strcat(ptr %a.gep.1, ptr %b.gep.1)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.1 <-> %res = tail call ptr @strcat(ptr %a.gep.1, ptr %b.gep.1)
|
|
; CHECK-NEXT: Both ModRef: Ptr: i8* %res <-> %res = tail call ptr @strcat(ptr %a.gep.1, ptr %b.gep.1)
|
|
; CHECK-NEXT: Both ModRef: Ptr: i8* %a.gep.5 <-> %res = tail call ptr @strcat(ptr %a.gep.1, ptr %b.gep.1)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.5 <-> %res = tail call ptr @strcat(ptr %a.gep.1, ptr %b.gep.1)
|
|
;
|
|
entry:
|
|
store i8 0, ptr %a
|
|
store i8 2, ptr %b
|
|
%a.gep.1 = getelementptr i8, ptr %a, i32 1
|
|
load i8, ptr %a.gep.1
|
|
%b.gep.1 = getelementptr i8, ptr %b, i32 1
|
|
load i8, ptr %b.gep.1
|
|
%res = tail call ptr @strcat(ptr %a.gep.1, ptr %b.gep.1)
|
|
load i8, ptr %res
|
|
%a.gep.5 = getelementptr i8, ptr %a, i32 5
|
|
store i8 1, ptr %a.gep.5
|
|
%b.gep.5 = getelementptr i8, ptr %b, i32 5
|
|
store i8 3, ptr %b.gep.5
|
|
ret ptr %res
|
|
}
|
|
|
|
declare ptr @strncat(ptr, ptr, i64)
|
|
|
|
define ptr @test_strncat_read_write_after(ptr noalias %a, ptr noalias %b, i64 %n) {
|
|
; CHECK-LABEL: Function: test_strncat_read_write_after
|
|
; CHECK: NoModRef: Ptr: i8* %a <-> %res = tail call ptr @strncat(ptr %a.gep.1, ptr %b.gep.1, i64 %n)
|
|
; CHECK-NEXT: NoModRef: Ptr: i8* %b <-> %res = tail call ptr @strncat(ptr %a.gep.1, ptr %b.gep.1, i64 %n)
|
|
; CHECK-NEXT: Both ModRef: Ptr: i8* %a.gep.1 <-> %res = tail call ptr @strncat(ptr %a.gep.1, ptr %b.gep.1, i64 %n)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.1 <-> %res = tail call ptr @strncat(ptr %a.gep.1, ptr %b.gep.1, i64 %n)
|
|
; CHECK-NEXT: Both ModRef: Ptr: i8* %res <-> %res = tail call ptr @strncat(ptr %a.gep.1, ptr %b.gep.1, i64 %n)
|
|
; CHECK-NEXT: Both ModRef: Ptr: i8* %a.gep.5 <-> %res = tail call ptr @strncat(ptr %a.gep.1, ptr %b.gep.1, i64 %n)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.5 <-> %res = tail call ptr @strncat(ptr %a.gep.1, ptr %b.gep.1, i64 %n)
|
|
;
|
|
entry:
|
|
store i8 0, ptr %a
|
|
store i8 2, ptr %b
|
|
%a.gep.1 = getelementptr i8, ptr %a, i32 1
|
|
load i8, ptr %a.gep.1
|
|
%b.gep.1 = getelementptr i8, ptr %b, i32 1
|
|
load i8, ptr %b.gep.1
|
|
%res = tail call ptr @strncat(ptr %a.gep.1, ptr %b.gep.1, i64 %n)
|
|
load i8, ptr %res
|
|
%a.gep.5 = getelementptr i8, ptr %a, i32 5
|
|
store i8 1, ptr %a.gep.5
|
|
%b.gep.5 = getelementptr i8, ptr %b, i32 5
|
|
store i8 3, ptr %b.gep.5
|
|
ret ptr %res
|
|
}
|
|
|
|
declare ptr @strcpy(ptr, ptr)
|
|
|
|
define ptr @test_strcpy_read_write_after(ptr noalias %a, ptr noalias %b) {
|
|
; CHECK-LABEL: Function: test_strcpy_read_write_after
|
|
; CHECK: NoModRef: Ptr: i8* %a <-> %res = tail call ptr @strcpy(ptr %a.gep.1, ptr %b.gep.1)
|
|
; CHECK-NEXT: NoModRef: Ptr: i8* %b <-> %res = tail call ptr @strcpy(ptr %a.gep.1, ptr %b.gep.1)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> %res = tail call ptr @strcpy(ptr %a.gep.1, ptr %b.gep.1)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.1 <-> %res = tail call ptr @strcpy(ptr %a.gep.1, ptr %b.gep.1)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %res <-> %res = tail call ptr @strcpy(ptr %a.gep.1, ptr %b.gep.1)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.5 <-> %res = tail call ptr @strcpy(ptr %a.gep.1, ptr %b.gep.1)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.5 <-> %res = tail call ptr @strcpy(ptr %a.gep.1, ptr %b.gep.1)
|
|
;
|
|
entry:
|
|
store i8 0, ptr %a
|
|
store i8 2, ptr %b
|
|
%a.gep.1 = getelementptr i8, ptr %a, i32 1
|
|
load i8, ptr %a.gep.1
|
|
%b.gep.1 = getelementptr i8, ptr %b, i32 1
|
|
load i8, ptr %b.gep.1
|
|
%res = tail call ptr @strcpy(ptr %a.gep.1, ptr %b.gep.1)
|
|
load i8, ptr %res
|
|
%a.gep.5 = getelementptr i8, ptr %a, i32 5
|
|
store i8 1, ptr %a.gep.5
|
|
%b.gep.5 = getelementptr i8, ptr %b, i32 5
|
|
store i8 3, ptr %b.gep.5
|
|
ret ptr %res
|
|
}
|
|
|
|
declare ptr @strncpy(ptr, ptr, i64)
|
|
|
|
define ptr @test_strncpy_const_size(ptr noalias %a, ptr noalias %b) {
|
|
; CHECK-LABEL: Function: test_strncpy_const_size
|
|
; CHECK: Just Mod: Ptr: i8* %a <-> %res = tail call ptr @strncpy(ptr %a, ptr %b, i64 4)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b <-> %res = tail call ptr @strncpy(ptr %a, ptr %b, i64 4)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %res <-> %res = tail call ptr @strncpy(ptr %a, ptr %b, i64 4)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> %res = tail call ptr @strncpy(ptr %a, ptr %b, i64 4)
|
|
; CHECK-NEXT: NoModRef: Ptr: i8* %a.gep.5 <-> %res = tail call ptr @strncpy(ptr %a, ptr %b, i64 4)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.1 <-> %res = tail call ptr @strncpy(ptr %a, ptr %b, i64 4)
|
|
; CHECK-NEXT: NoModRef: Ptr: i8* %b.gep.5 <-> %res = tail call ptr @strncpy(ptr %a, ptr %b, i64 4)
|
|
;
|
|
entry:
|
|
load i8, ptr %a
|
|
load i8, ptr %b
|
|
%res = tail call ptr @strncpy(ptr %a, ptr %b, i64 4)
|
|
load i8, ptr %res
|
|
%a.gep.1 = getelementptr i8, ptr %a, i32 1
|
|
store i8 0, ptr %a.gep.1
|
|
%a.gep.5 = getelementptr i8, ptr %a, i32 5
|
|
store i8 1, ptr %a.gep.5
|
|
%b.gep.1 = getelementptr i8, ptr %b, i32 1
|
|
store i8 2, ptr %b.gep.1
|
|
%b.gep.5 = getelementptr i8, ptr %b, i32 5
|
|
store i8 3, ptr %b.gep.5
|
|
ret ptr %res
|
|
}
|
|
|
|
define ptr @test_strncpy_variable_size(ptr noalias %a, ptr noalias %b, i64 %n) {
|
|
; CHECK-LABEL: Function: test_strncpy_variable_size
|
|
; CHECK: Just Mod: Ptr: i8* %a <-> %res = tail call ptr @strncpy(ptr %a, ptr %b, i64 %n)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b <-> %res = tail call ptr @strncpy(ptr %a, ptr %b, i64 %n)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %res <-> %res = tail call ptr @strncpy(ptr %a, ptr %b, i64 %n)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> %res = tail call ptr @strncpy(ptr %a, ptr %b, i64 %n)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.5 <-> %res = tail call ptr @strncpy(ptr %a, ptr %b, i64 %n)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.1 <-> %res = tail call ptr @strncpy(ptr %a, ptr %b, i64 %n)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.5 <-> %res = tail call ptr @strncpy(ptr %a, ptr %b, i64 %n)
|
|
;
|
|
entry:
|
|
load i8, ptr %a
|
|
load i8, ptr %b
|
|
%res = tail call ptr @strncpy(ptr %a, ptr %b, i64 %n)
|
|
load i8, ptr %res
|
|
%a.gep.1 = getelementptr i8, ptr %a, i32 1
|
|
store i8 0, ptr %a.gep.1
|
|
%a.gep.5 = getelementptr i8, ptr %a, i32 5
|
|
store i8 1, ptr %a.gep.5
|
|
%b.gep.1 = getelementptr i8, ptr %b, i32 1
|
|
store i8 2, ptr %b.gep.1
|
|
%b.gep.5 = getelementptr i8, ptr %b, i32 5
|
|
store i8 3, ptr %b.gep.5
|
|
ret ptr %res
|
|
}
|
|
|
|
declare ptr @__memset_chk(ptr writeonly, i32, i64, i64)
|
|
|
|
; CHECK-LABEL: Function: test_memset_chk_const_size
|
|
define ptr @test_memset_chk_const_size(ptr noalias %a, i64 %n) {
|
|
; CHECK: Just Mod: Ptr: i8* %a <-> %res = tail call ptr @__memset_chk(ptr %a, i32 0, i64 4, i64 %n)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %res <-> %res = tail call ptr @__memset_chk(ptr %a, i32 0, i64 4, i64 %n)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> %res = tail call ptr @__memset_chk(ptr %a, i32 0, i64 4, i64 %n)
|
|
; CHECK-NEXT: NoModRef: Ptr: i8* %a.gep.5 <-> %res = tail call ptr @__memset_chk(ptr %a, i32 0, i64 4, i64 %n)
|
|
;
|
|
entry:
|
|
load i8, ptr %a
|
|
%res = tail call ptr @__memset_chk(ptr %a, i32 0, i64 4, i64 %n)
|
|
load i8, ptr %res
|
|
%a.gep.1 = getelementptr i8, ptr %a, i32 1
|
|
store i8 0, ptr %a.gep.1
|
|
%a.gep.5 = getelementptr i8, ptr %a, i32 5
|
|
store i8 1, ptr %a.gep.5
|
|
ret ptr %res
|
|
}
|
|
|
|
define ptr @test_memset_chk_variable_size(ptr noalias %a, i64 %n.1, i64 %n.2) {
|
|
; CHECK-LABEL: Function: test_memset_chk_variable_size
|
|
; CHECK: Just Mod: Ptr: i8* %a <-> %res = tail call ptr @__memset_chk(ptr %a, i32 0, i64 %n.1, i64 %n.2)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %res <-> %res = tail call ptr @__memset_chk(ptr %a, i32 0, i64 %n.1, i64 %n.2)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> %res = tail call ptr @__memset_chk(ptr %a, i32 0, i64 %n.1, i64 %n.2)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.5 <-> %res = tail call ptr @__memset_chk(ptr %a, i32 0, i64 %n.1, i64 %n.2)
|
|
;
|
|
entry:
|
|
load i8, ptr %a
|
|
%res = tail call ptr @__memset_chk(ptr %a, i32 0, i64 %n.1, i64 %n.2)
|
|
load i8, ptr %res
|
|
%a.gep.1 = getelementptr i8, ptr %a, i32 1
|
|
store i8 0, ptr %a.gep.1
|
|
%a.gep.5 = getelementptr i8, ptr %a, i32 5
|
|
store i8 1, ptr %a.gep.5
|
|
ret ptr %res
|
|
}
|
|
|
|
declare ptr @__memcpy_chk(ptr writeonly, ptr readonly, i64, i64)
|
|
|
|
define ptr @test_memcpy_chk_const_size(ptr noalias %a, ptr noalias %b, i64 %n) {
|
|
; CHECK-LABEL: Function: test_memcpy_chk_const_size
|
|
; CHECK: Just Mod: Ptr: i8* %a <-> %res = tail call ptr @__memcpy_chk(ptr %a, ptr %b, i64 4, i64 %n)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %res <-> %res = tail call ptr @__memcpy_chk(ptr %a, ptr %b, i64 4, i64 %n)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> %res = tail call ptr @__memcpy_chk(ptr %a, ptr %b, i64 4, i64 %n)
|
|
; CHECK-NEXT: NoModRef: Ptr: i8* %a.gep.5 <-> %res = tail call ptr @__memcpy_chk(ptr %a, ptr %b, i64 4, i64 %n)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.1 <-> %res = tail call ptr @__memcpy_chk(ptr %a, ptr %b, i64 4, i64 %n)
|
|
; CHECK-NEXT: NoModRef: Ptr: i8* %b.gep.5 <-> %res = tail call ptr @__memcpy_chk(ptr %a, ptr %b, i64 4, i64 %n)
|
|
;
|
|
entry:
|
|
load i8, ptr %a
|
|
%res = tail call ptr @__memcpy_chk(ptr %a, ptr %b, i64 4, i64 %n)
|
|
load i8, ptr %res
|
|
%a.gep.1 = getelementptr i8, ptr %a, i32 1
|
|
store i8 0, ptr %a.gep.1
|
|
%a.gep.5 = getelementptr i8, ptr %a, i32 5
|
|
store i8 1, ptr %a.gep.5
|
|
%b.gep.1 = getelementptr i8, ptr %b, i32 1
|
|
store i8 0, ptr %b.gep.1
|
|
%b.gep.5 = getelementptr i8, ptr %b, i32 5
|
|
store i8 1, ptr %b.gep.5
|
|
ret ptr %res
|
|
}
|
|
|
|
define ptr @test_memcpy_chk_variable_size(ptr noalias %a, ptr noalias %b, i64 %n.1, i64 %n.2) {
|
|
; CHECK-LABEL: Function: test_memcpy_chk_variable_size
|
|
; CHECK: Just Mod: Ptr: i8* %a <-> %res = tail call ptr @__memcpy_chk(ptr %a, ptr %b, i64 %n.1, i64 %n.2)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %res <-> %res = tail call ptr @__memcpy_chk(ptr %a, ptr %b, i64 %n.1, i64 %n.2)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> %res = tail call ptr @__memcpy_chk(ptr %a, ptr %b, i64 %n.1, i64 %n.2)
|
|
; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.5 <-> %res = tail call ptr @__memcpy_chk(ptr %a, ptr %b, i64 %n.1, i64 %n.2)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.1 <-> %res = tail call ptr @__memcpy_chk(ptr %a, ptr %b, i64 %n.1, i64 %n.2)
|
|
; CHECK-NEXT: Just Ref: Ptr: i8* %b.gep.5 <-> %res = tail call ptr @__memcpy_chk(ptr %a, ptr %b, i64 %n.1, i64 %n.2)
|
|
;
|
|
entry:
|
|
load i8, ptr %a
|
|
%res = tail call ptr @__memcpy_chk(ptr %a, ptr %b, i64 %n.1, i64 %n.2)
|
|
load i8, ptr %res
|
|
%a.gep.1 = getelementptr i8, ptr %a, i32 1
|
|
store i8 0, ptr %a.gep.1
|
|
%a.gep.5 = getelementptr i8, ptr %a, i32 5
|
|
store i8 1, ptr %a.gep.5
|
|
%b.gep.1 = getelementptr i8, ptr %b, i32 1
|
|
store i8 0, ptr %b.gep.1
|
|
%b.gep.5 = getelementptr i8, ptr %b, i32 5
|
|
store i8 1, ptr %b.gep.5
|
|
ret ptr %res
|
|
}
|