1 ; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
3 define void @okay(ptr %p, i32 %x) {
4 call void asm "addl $1, $0", "=*rm,r"(ptr elementtype(i32) %p, i32 %x)
8 ; CHECK: Operand for indirect constraint must have pointer type
9 ; CHECK-NEXT: call void asm "addl $1, $0", "=*rm,r"(i32 %p, i32 %x)
10 define void @not_pointer_arg(i32 %p, i32 %x) {
11 call void asm "addl $1, $0", "=*rm,r"(i32 %p, i32 %x)
15 ; CHECK: Elementtype attribute can only be applied for indirect constraints
16 ; CHECK-NEXT: call void asm "addl $1, $0", "=*rm,r"(ptr elementtype(i32) %p, ptr elementtype(i32) %x)
17 define void @not_indirect(ptr %p, ptr %x) {
18 call void asm "addl $1, $0", "=*rm,r"(ptr elementtype(i32) %p, ptr elementtype(i32) %x)
22 ; CHECK: Operand for indirect constraint must have elementtype attribute
23 ; CHECK-NEXT: call void asm "addl $1, $0", "=*rm,r"(ptr %p, i32 %x)
24 define void @missing_elementtype(ptr %p, i32 %x) {
25 call void asm "addl $1, $0", "=*rm,r"(ptr %p, i32 %x)
29 ; CHECK: Operand for indirect constraint must have pointer type
30 ; CHECK-NEXT: invoke void asm "addl $1, $0", "=*rm,r"(i32 %p, i32 %x)
31 define void @not_pointer_arg_invoke(i32 %p, i32 %x) personality ptr null {
32 invoke void asm "addl $1, $0", "=*rm,r"(i32 %p, i32 %x)
33 to label %cont unwind label %lpad
44 ; CHECK: Operand for indirect constraint must have pointer type
45 ; CHECK-NEXT: callbr void asm "addl $1, $0", "=*rm,r"(i32 %p, i32 %x)
46 define void @not_pointer_arg_callbr(i32 %p, i32 %x) {
47 callbr void asm "addl $1, $0", "=*rm,r"(i32 %p, i32 %x)