1 ; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
3 declare void @some_function(ptr)
5 ; CHECK: Attribute 'elementtype(i32)' applied to incompatible type!
6 define void @type_mismatch1() {
7 call ptr @llvm.preserve.array.access.index.p0.p0(ptr null, i32 elementtype(i32) 0, i32 0)
11 ; CHECK: Attribute 'elementtype' can only be applied to intrinsics and inline asm.
12 define void @not_intrinsic() {
13 call void @some_function(ptr elementtype(i32) null)
17 ; CHECK: Attribute 'elementtype' can only be applied to a callsite.
18 define void @llvm.not_call(ptr elementtype(i32)) {
22 define void @elementtype_required() {
23 ; CHECK: Intrinsic requires elementtype attribute on first argument.
24 call ptr @llvm.preserve.array.access.index.p0.p0(ptr null, i32 0, i32 0)
25 ; CHECK: Intrinsic requires elementtype attribute on first argument.
26 call ptr @llvm.preserve.struct.access.index.p0.p0(ptr null, i32 0, i32 0)
30 declare ptr @llvm.preserve.array.access.index.p0.p0(ptr, i32, i32)
31 declare ptr @llvm.preserve.struct.access.index.p0.p0(ptr, i32, i32)