1 ; RUN: not opt -passes=verify < %s 2>&1 | FileCheck %s
3 define void @test_memcpy(ptr %P, ptr %Q, i32 %A, i32 %E) {
4 ; CHECK: immarg operand has non-immediate parameter
6 ; 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)
9 ; CHECK: element size of the element-wise atomic memory intrinsic must be a power of 2
10 call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 1, i32 3)
12 call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 7, i32 4)
14 ; CHECK: incorrect alignment of the destination argument
15 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 argument
17 call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr align 1 %P, ptr align 4 %Q, i32 4, i32 4)
19 ; CHECK: incorrect alignment of the source argument
20 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 argument
22 call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 1 %Q, i32 4, i32 4)
27 declare void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i32) nounwind
29 define void @test_memmove(ptr %P, ptr %Q, i32 %A, i32 %E) {
30 ; CHECK: immarg operand has non-immediate parameter
32 ; 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)
35 ; CHECK: element size of the element-wise atomic memory intrinsic must be a power of 2
36 call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 1, i32 3)
38 call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 7, i32 4)
40 ; CHECK: incorrect alignment of the destination argument
41 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 argument
43 call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr align 1 %P, ptr align 4 %Q, i32 4, i32 4)
45 ; CHECK: incorrect alignment of the source argument
46 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 argument
48 call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 1 %Q, i32 4, i32 4)
53 declare void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i32) nounwind
55 define void @test_memset(ptr %P, i8 %V, i32 %A, i32 %E) {
56 ; CHECK: immarg operand has non-immediate parameter
58 ; 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)
61 ; CHECK: element size of the element-wise atomic memory intrinsic must be a power of 2
62 call void @llvm.memset.element.unordered.atomic.p0.i32(ptr align 4 %P, i8 %V, i32 1, i32 3)
64 call void @llvm.memset.element.unordered.atomic.p0.i32(ptr align 4 %P, i8 %V, i32 7, i32 4)
66 ; CHECK: incorrect alignment of the destination argument
67 call void @llvm.memset.element.unordered.atomic.p0.i32(ptr %P, i8 %V, i32 1, i32 1)
68 ; CHECK: incorrect alignment of the destination argument
69 call void @llvm.memset.element.unordered.atomic.p0.i32(ptr align 1 %P, i8 %V, i32 4, i32 4)
73 declare void @llvm.memset.element.unordered.atomic.p0.i32(ptr nocapture, i8, i32, i32) nounwind
75 ; CHECK: input module is broken!