1 ; RUN: split-file %s %t
2 ; RUN: not llvm-as < %t/parse-fail.ll 2>&1 | FileCheck %s --check-prefix=CHECK-PARSE-FAIL
3 ; RUN: not llvm-as < %t/input-before-output.ll 2>&1 | FileCheck %s --check-prefix=CHECK-INPUT-BEFORE-OUTPUT
4 ; RUN: not llvm-as < %t/input-after-clobber.ll 2>&1 | FileCheck %s --check-prefix=CHECK-INPUT-AFTER-CLOBBER
5 ; RUN: not llvm-as < %t/must-return-void.ll 2>&1 | FileCheck %s --check-prefix=CHECK-MUST-RETURN-VOID
6 ; RUN: not llvm-as < %t/cannot-be-struct.ll 2>&1 | FileCheck %s --check-prefix=CHECK-CANNOT-BE-STRUCT
7 ; RUN: not llvm-as < %t/incorrect-struct-elements.ll 2>&1 | FileCheck %s --check-prefix=CHECK-INCORRECT-STRUCT-ELEMENTS
8 ; RUN: not llvm-as < %t/incorrect-arg-num.ll 2>&1 | FileCheck %s --check-prefix=CHECK-INCORRECT-ARG-NUM
9 ; RUN: not llvm-as < %t/label-after-clobber.ll 2>&1 | FileCheck %s --check-prefix=CHECK-LABEL-AFTER-CLOBBER
10 ; RUN: not llvm-as < %t/output-after-label.ll 2>&1 | FileCheck %s --check-prefix=CHECK-OUTPUT-AFTER-LABEL
13 ; CHECK-PARSE-FAIL: failed to parse constraints
15 ; "~x{21}" is not a valid clobber constraint.
16 call void asm sideeffect "mov x0, #42", "~{x0},~{x19},~x{21}"()
20 ;--- input-before-output.ll
21 ; CHECK-INPUT-BEFORE-OUTPUT: output constraint occurs after input, clobber or label constraint
23 call void asm sideeffect "mov x0, #42", "r,=r"()
27 ;--- input-after-clobber.ll
28 ; CHECK-INPUT-AFTER-CLOBBER: input constraint occurs after clobber constraint
30 call void asm sideeffect "mov x0, #42", "~{x0},r"()
34 ;--- must-return-void.ll
35 ; CHECK-MUST-RETURN-VOID: inline asm without outputs must return void
37 call i32 asm sideeffect "mov x0, #42", ""()
41 ;--- cannot-be-struct.ll
42 ; CHECK-CANNOT-BE-STRUCT: inline asm with one output cannot return struct
44 call { i32 } asm sideeffect "mov x0, #42", "=r"()
48 ;--- incorrect-struct-elements.ll
49 ; CHECK-INCORRECT-STRUCT-ELEMENTS: number of output constraints does not match number of return struct elements
51 call { i32 } asm sideeffect "mov x0, #42", "=r,=r"()
55 ;--- incorrect-arg-num.ll
56 ; CHECK-INCORRECT-ARG-NUM: number of input constraints does not match number of parameters
58 call void asm sideeffect "mov x0, #42", "r"()
62 ;--- label-after-clobber.ll
63 ; CHECK-LABEL-AFTER-CLOBBER: label constraint occurs after clobber constraint
65 callbr void asm sideeffect "", "~{flags},!i"()
66 to label %1 [label %2]
73 ;--- output-after-label.ll
74 ; CHECK-OUTPUT-AFTER-LABEL: output constraint occurs after input, clobber or label constraint
76 %res = callbr i32 asm sideeffect "", "!i,=r,~{flags}"()
77 to label %1 [label %2]