1 ; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
3 declare void @some_function(i32*)
5 ; CHECK: Attribute 'elementtype(i32)' applied to incompatible type!
6 define void @type_mismatch1() {
7 call i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32* null, i32 elementtype(i32) 0, i32 0)
11 ; CHECK: Attribute 'elementtype' type does not match parameter!
12 define void @type_mismatch2() {
13 call i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32* elementtype(i64) null, i32 0, i32 0)
17 ; CHECK: Attribute 'elementtype' can only be applied to intrinsics.
18 define void @not_intrinsic() {
19 call void @some_function(i32* elementtype(i32) null)
23 ; CHECK: Attribute 'elementtype' can only be applied to a callsite.
24 define void @llvm.not_call(i32* elementtype(i32)) {
28 define void @elementtype_required() {
29 ; CHECK: Intrinsic requires elementtype attribute on first argument.
30 call i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32* null, i32 0, i32 0)
31 ; CHECK: Intrinsic requires elementtype attribute on first argument.
32 call i32* @llvm.preserve.struct.access.index.p0i32.p0i32(i32* null, i32 0, i32 0)
36 declare i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32*, i32, i32)
37 declare i32* @llvm.preserve.struct.access.index.p0i32.p0i32(i32*, i32, i32)