1 ; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
3 define void @okay(i32* %p, i32 %x) {
4 call void asm "addl $1, $0", "=*rm,r"(i32* elementtype(i32) %p, i32 %x)
8 ; CHECK: Attribute 'elementtype' type does not match parameter!
9 ; CHECK-NEXT: call void asm "addl $1, $0", "=*rm,r"(i32* elementtype(i64) %p, i32 %x)
10 define void @wrong_element_type(i32* %p, i32 %x) {
11 call void asm "addl $1, $0", "=*rm,r"(i32* elementtype(i64) %p, i32 %x)
15 ; CHECK: Operand for indirect constraint must have pointer type
16 ; CHECK-NEXT: call void asm "addl $1, $0", "=*rm,r"(i32 %p, i32 %x)
17 define void @not_pointer_arg(i32 %p, i32 %x) {
18 call void asm "addl $1, $0", "=*rm,r"(i32 %p, i32 %x)
22 ; CHECK: Elementtype attribute can only be applied for indirect constraints
23 ; CHECK-NEXT: call void asm "addl $1, $0", "=*rm,r"(i32* elementtype(i32) %p, i32* elementtype(i32) %x)
24 define void @not_indirect(i32* %p, i32* %x) {
25 call void asm "addl $1, $0", "=*rm,r"(i32* elementtype(i32) %p, i32* elementtype(i32) %x)
29 ; CHECK: Operand for indirect constraint must have elementtype attribute
30 ; CHECK-NEXT: call void asm "addl $1, $0", "=*rm,r"(i32* %p, i32 %x)
31 define void @missing_elementtype(i32* %p, i32 %x) {
32 call void asm "addl $1, $0", "=*rm,r"(i32* %p, i32 %x)
36 ; CHECK: Operand for indirect constraint must have pointer type
37 ; CHECK-NEXT: invoke void asm "addl $1, $0", "=*rm,r"(i32 %p, i32 %x)
38 define void @not_pointer_arg_invoke(i32 %p, i32 %x) personality i8* null {
39 invoke void asm "addl $1, $0", "=*rm,r"(i32 %p, i32 %x)
40 to label %cont unwind label %lpad
51 ; CHECK: Operand for indirect constraint must have pointer type
52 ; CHECK-NEXT: callbr void asm "addl $1, $0", "=*rm,r"(i32 %p, i32 %x)
53 define void @not_pointer_arg_callbr(i32 %p, i32 %x) {
54 callbr void asm "addl $1, $0", "=*rm,r"(i32 %p, i32 %x)