1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=m68k < %s -o - | FileCheck %s
4 ; This function is primarily testing constant constraints that can NOT
5 ; be easily checked by Clang. For example, 'K' and 'M' are both
6 ; constraints for values that are outside certain numerical range.
7 define void @constant_constraints() {
8 ; CHECK-LABEL: constant_constraints:
9 ; CHECK: .cfi_startproc
10 ; CHECK-NEXT: ; %bb.0: ; %entry
12 ; CHECK-NEXT: move.l #1, %d1
15 ; CHECK-NEXT: move.l #8, %d1
18 ; CHECK-NEXT: move.l #-32768, %d1
21 ; CHECK-NEXT: move.l #32767, %d1
24 ; CHECK-NEXT: move.l #-129, %d1
27 ; CHECK-NEXT: move.l #128, %d1
30 ; CHECK-NEXT: move.l #-8, %d1
33 ; CHECK-NEXT: move.l #-1, %d1
36 ; CHECK-NEXT: move.l #-257, %d1
39 ; CHECK-NEXT: move.l #256, %d1
42 ; CHECK-NEXT: move.l #24, %d1
45 ; CHECK-NEXT: move.l #31, %d1
48 ; CHECK-NEXT: move.l #16, %d1
51 ; CHECK-NEXT: move.l #8, %d1
54 ; CHECK-NEXT: move.l #15, %d1
57 ; CHECK-NEXT: move.l #0, %d1
60 ; CHECK-NEXT: move.l #1, %d1
63 ; CHECK-NEXT: move.l #-32769, %d1
66 ; CHECK-NEXT: move.l #32768, %d1
70 call void asm sideeffect "move.l $0, %d1", "I"(i32 1)
71 call void asm sideeffect "move.l $0, %d1", "I"(i32 8)
72 call void asm sideeffect "move.l $0, %d1", "J"(i32 -32768)
73 call void asm sideeffect "move.l $0, %d1", "J"(i32 32767)
74 call void asm sideeffect "move.l $0, %d1", "K"(i32 -129)
75 call void asm sideeffect "move.l $0, %d1", "K"(i32 128)
76 call void asm sideeffect "move.l $0, %d1", "L"(i32 -8)
77 call void asm sideeffect "move.l $0, %d1", "L"(i32 -1)
78 call void asm sideeffect "move.l $0, %d1", "M"(i32 -257)
79 call void asm sideeffect "move.l $0, %d1", "M"(i32 256)
80 call void asm sideeffect "move.l $0, %d1", "N"(i32 24)
81 call void asm sideeffect "move.l $0, %d1", "N"(i32 31)
82 call void asm sideeffect "move.l $0, %d1", "O"(i32 16)
83 call void asm sideeffect "move.l $0, %d1", "P"(i32 8)
84 call void asm sideeffect "move.l $0, %d1", "P"(i32 15)
85 call void asm sideeffect "move.l $0, %d1", "^C0"(i32 0)
86 call void asm sideeffect "move.l $0, %d1", "^Ci"(i32 1)
87 call void asm sideeffect "move.l $0, %d1", "^Cj"(i32 -32769)
88 call void asm sideeffect "move.l $0, %d1", "^Cj"(i32 32768)
92 define void @register_constraints() {
93 ; CHECK-LABEL: register_constraints:
94 ; CHECK: .cfi_startproc
95 ; CHECK-NEXT: ; %bb.0: ; %entry
96 ; CHECK-NEXT: suba.l #4, %sp
97 ; CHECK-NEXT: .cfi_def_cfa_offset -8
99 ; CHECK-NEXT: move.l #94, %d0
100 ; CHECK-NEXT: ;NO_APP
101 ; CHECK-NEXT: move.l %d0, (0,%sp)
103 ; CHECK-NEXT: move.l #87, %d0
104 ; CHECK-NEXT: ;NO_APP
105 ; CHECK-NEXT: move.l %d0, (0,%sp)
107 ; CHECK-NEXT: move.l #66, %a0
108 ; CHECK-NEXT: ;NO_APP
109 ; CHECK-NEXT: move.l %a0, (0,%sp)
110 ; CHECK-NEXT: adda.l #4, %sp
113 %out = alloca i32, align 4
114 %0 = call i32 asm sideeffect "move.l #94, $0", "=r"()
115 store i32 %0, i32* %out, align 4
116 %1 = call i32 asm sideeffect "move.l #87, $0", "=d"()
117 store i32 %1, i32* %out, align 4
118 %2 = call i32 asm sideeffect "move.l #66, $0", "=a"()
119 store i32 %2, i32* %out, align 4