|
| 1 | +; RUN: llc < %s -march=arm64 | FileCheck %s -check-prefixes=NOTCPU --match-full-lines |
| 2 | +; RUN: llc < %s -mtriple=arm64-apple-macosx -mcpu=apple-m1 | FileCheck %s -check-prefixes=CPU --match-full-lines |
| 3 | +; RUN: llc < %s -mtriple=arm64-apple-macosx -mcpu=apple-m1 -mattr=-zcm | FileCheck %s -check-prefixes=NOTATTR --match-full-lines |
| 4 | +; RUN: llc < %s -mtriple=arm64-apple-macosx -mattr=+zcm | FileCheck %s -check-prefixes=ATTR --match-full-lines |
| 5 | + |
| 6 | +define void @t(i32 %a, i32 %b, i32 %c, i32 %d) { |
| 7 | +entry: |
| 8 | +; CHECK-LABEL: t: |
| 9 | +; NOTCPU: mov w0, w2 |
| 10 | +; NOTCPU: mov w1, w3 |
| 11 | +; NOTCPU: mov [[REG2:w[0-9]+]], w3 |
| 12 | +; NOTCPU: mov [[REG1:w[0-9]+]], w2 |
| 13 | +; NOTCPU-NEXT: bl {{_?foo}} |
| 14 | +; NOTCPU: mov w0, [[REG1]] |
| 15 | +; NOTCPU: mov w1, [[REG2]] |
| 16 | + |
| 17 | +; CPU: mov [[REG2:x[0-9]+]], x3 |
| 18 | +; CPU: mov [[REG1:x[0-9]+]], x2 |
| 19 | +; CPU: mov x0, x2 |
| 20 | +; CPU: mov x1, x3 |
| 21 | +; CPU-NEXT: bl {{_?foo}} |
| 22 | +; CPU: mov x0, [[REG1]] |
| 23 | +; CPU: mov x1, [[REG2]] |
| 24 | + |
| 25 | +; NOTATTR: mov [[REG2:w[0-9]+]], w3 |
| 26 | +; NOTATTR: mov [[REG1:w[0-9]+]], w2 |
| 27 | +; NOTATTR: mov w0, w2 |
| 28 | +; NOTATTR: mov w1, w3 |
| 29 | +; NOTATTR-NEXT: bl {{_?foo}} |
| 30 | +; NOTATTR: mov w0, [[REG1]] |
| 31 | +; NOTATTR: mov w1, [[REG2]] |
| 32 | + |
| 33 | +; ATTR: mov x0, x2 |
| 34 | +; ATTR: mov x1, x3 |
| 35 | +; ATTR: mov [[REG2:x[0-9]+]], x3 |
| 36 | +; ATTR: mov [[REG1:x[0-9]+]], x2 |
| 37 | +; ATTR-NEXT: bl {{_?foo}} |
| 38 | +; ATTR: mov x0, [[REG1]] |
| 39 | +; ATTR: mov x1, [[REG2]] |
| 40 | + %call = call i32 @foo(i32 %c, i32 %d) |
| 41 | + %call1 = call i32 @foo(i32 %c, i32 %d) |
| 42 | + unreachable |
| 43 | +} |
| 44 | + |
| 45 | +declare i32 @foo(i32, i32) |
0 commit comments