Dylan McKay | 0d4778f | 2016-11-09 23:46:52 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=avr | FileCheck %s |
| 2 | |
| 3 | ; Checks that `sin` and `cos` nodes are expanded into calls to |
| 4 | ; the `sin` and `cos` runtime library functions. |
| 5 | ; On AVR, the only floats supported are 32-bits, and so the |
| 6 | ; function names have no `f` or `d` suffix. |
| 7 | |
| 8 | declare float @llvm.sin.f32(float %x) |
| 9 | declare float @llvm.cos.f32(float %x) |
| 10 | |
| 11 | define float @do_sin(float %a) { |
| 12 | ; CHECK-LABEL: do_sin: |
| 13 | ; CHECK: {{sin$}} |
| 14 | %result = call float @llvm.sin.f32(float %a) |
| 15 | ret float %result |
| 16 | } |
| 17 | |
| 18 | ; CHECK-LABEL: do_cos: |
| 19 | ; CHECK: {{cos$}} |
| 20 | define float @do_cos(float %a) { |
| 21 | %result = call float @llvm.cos.f32(float %a) |
| 22 | ret float %result |
| 23 | } |