brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.9 KiB · 0ddc615 Raw
76 lines · plain
1; RUN: not opt -passes=verify < %s 2>&1 | FileCheck %s2 3define void @test_memcpy(ptr %P, ptr %Q, i32 %A, i32 %E) {4  ; CHECK: immarg operand has non-immediate parameter5  ; CHECK: i32 %E6  ; CHECK-NEXT: call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 1, i32 %E)7  call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 1, i32 %E)8 9  ; CHECK: element size of the element-wise atomic memory intrinsic must be a power of 210  call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 1, i32 3)11 12  call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 7, i32 4)13 14  ; CHECK: incorrect alignment of the destination argument15  call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr %P, ptr align 4 %Q, i32 1, i32 1)16  ; CHECK: incorrect alignment of the destination argument17  call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr align 1 %P, ptr align 4 %Q, i32 4, i32 4)18 19  ; CHECK: incorrect alignment of the source argument20  call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr %Q, i32 1, i32 1)21  ; CHECK: incorrect alignment of the source argument22  call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 1 %Q, i32 4, i32 4)23 24  ret void25}26 27declare void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i32) nounwind28 29define void @test_memmove(ptr %P, ptr %Q, i32 %A, i32 %E) {30  ; CHECK: immarg operand has non-immediate parameter31  ; CHECK-NEXT: i32 %E32  ; CHECK-NEXT: call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 1, i32 %E)33  call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 1, i32 %E)34 35  ; CHECK: element size of the element-wise atomic memory intrinsic must be a power of 236  call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 1, i32 3)37 38  call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 7, i32 4)39 40  ; CHECK: incorrect alignment of the destination argument41  call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr %P, ptr align 4 %Q, i32 1, i32 1)42  ; CHECK: incorrect alignment of the destination argument43  call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr align 1 %P, ptr align 4 %Q, i32 4, i32 4)44 45  ; CHECK: incorrect alignment of the source argument46  call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr %Q, i32 1, i32 1)47  ; CHECK: incorrect alignment of the source argument48  call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 1 %Q, i32 4, i32 4)49 50  ret void51}52 53declare void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i32) nounwind54 55define void @test_memset(ptr %P, i8 %V, i32 %A, i32 %E) {56  ; CHECK: immarg operand has non-immediate parameter57  ; CHECK: i32 %E58  ; CHECK: call void @llvm.memset.element.unordered.atomic.p0.i32(ptr align 4 %P, i8 %V, i32 1, i32 %E)59  call void @llvm.memset.element.unordered.atomic.p0.i32(ptr align 4 %P, i8 %V, i32 1, i32 %E)60 61  ; CHECK: element size of the element-wise atomic memory intrinsic must be a power of 262  call void @llvm.memset.element.unordered.atomic.p0.i32(ptr align 4 %P, i8 %V, i32 1, i32 3)63 64  call void @llvm.memset.element.unordered.atomic.p0.i32(ptr align 4 %P, i8 %V, i32 7, i32 4)65 66  ; CHECK: incorrect alignment of the destination argument67  call void @llvm.memset.element.unordered.atomic.p0.i32(ptr %P, i8 %V, i32 1, i32 1)68  ; CHECK: incorrect alignment of the destination argument69  call void @llvm.memset.element.unordered.atomic.p0.i32(ptr align 1 %P, i8 %V, i32 4, i32 4)70 71  ret void72}73declare void @llvm.memset.element.unordered.atomic.p0.i32(ptr nocapture, i8, i32, i32) nounwind74 75; CHECK: input module is broken!76