Reed Kotler | 5c29d63 | 2013-12-15 20:49:30 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips16 -relocation-model=pic < %s | FileCheck %s -check-prefix=PIC |
Reed Kotler | 0ff4001 | 2013-12-10 14:29:38 +0000 | [diff] [blame] | 2 | |
Reed Kotler | 5c29d63 | 2013-12-15 20:49:30 +0000 | [diff] [blame] | 3 | ; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips16 -relocation-model=static < %s | FileCheck %s -check-prefix=STATIC |
Reed Kotler | 0ff4001 | 2013-12-10 14:29:38 +0000 | [diff] [blame] | 4 | |
Reed Kotler | 0ff4001 | 2013-12-10 14:29:38 +0000 | [diff] [blame] | 5 | |
| 6 | @xi = common global i32 0, align 4 |
| 7 | @x = common global float 0.000000e+00, align 4 |
| 8 | @xd = common global double 0.000000e+00, align 8 |
| 9 | |
| 10 | ; Function Attrs: nounwind |
| 11 | define void @it() #0 { |
| 12 | entry: |
| 13 | %call = call i32 @i(i32 1) |
| 14 | store i32 %call, i32* @xi, align 4 |
| 15 | ret void |
Reed Kotler | 5c29d63 | 2013-12-15 20:49:30 +0000 | [diff] [blame] | 16 | ; PIC: .ent it |
| 17 | ; STATIC: .ent it |
| 18 | ; PIC: save $16, $17, $ra, [[FS:[0-9]+]] |
| 19 | ; STATIC: save $16, $ra, [[FS:[0-9]+]] |
| 20 | ; PIC: restore $16, $17, $ra, [[FS]] |
| 21 | ; STATIC: restore $16, $ra, [[FS]] |
| 22 | ; PIC: .end it |
| 23 | ; STATIC: .end it |
Reed Kotler | 0ff4001 | 2013-12-10 14:29:38 +0000 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | declare i32 @i(i32) #1 |
| 27 | |
| 28 | ; Function Attrs: nounwind |
| 29 | define void @ft() #0 { |
| 30 | entry: |
| 31 | %call = call float @f() |
| 32 | store float %call, float* @x, align 4 |
| 33 | ret void |
Reed Kotler | 5c29d63 | 2013-12-15 20:49:30 +0000 | [diff] [blame] | 34 | ; PIC: .ent ft |
| 35 | ; PIC: save $16, $17, $ra, $18, [[FS:[0-9]+]] |
| 36 | ; PIC: restore $16, $17, $ra, $18, [[FS]] |
| 37 | ; PIC: .end ft |
Reed Kotler | 0ff4001 | 2013-12-10 14:29:38 +0000 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | declare float @f() #1 |
| 41 | |
| 42 | ; Function Attrs: nounwind |
| 43 | define void @dt() #0 { |
| 44 | entry: |
| 45 | %call = call double @d() |
| 46 | store double %call, double* @xd, align 8 |
| 47 | ret void |
Reed Kotler | 5c29d63 | 2013-12-15 20:49:30 +0000 | [diff] [blame] | 48 | ; PIC: .ent dt |
| 49 | ; PIC: save $16, $17, $ra, $18, [[FS:[0-9]+]] |
| 50 | ; PIC: restore $16, $17, $ra, $18, [[FS]] |
| 51 | ; PIC: .end dt |
Reed Kotler | 0ff4001 | 2013-12-10 14:29:38 +0000 | [diff] [blame] | 52 | } |
| 53 | |
| 54 | declare double @d() #1 |
| 55 | |
| 56 | ; Function Attrs: nounwind |
| 57 | define void @fft() #0 { |
| 58 | entry: |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame^] | 59 | %0 = load float, float* @x, align 4 |
Reed Kotler | 0ff4001 | 2013-12-10 14:29:38 +0000 | [diff] [blame] | 60 | %call = call float @ff(float %0) |
| 61 | store float %call, float* @x, align 4 |
| 62 | ret void |
Reed Kotler | 5c29d63 | 2013-12-15 20:49:30 +0000 | [diff] [blame] | 63 | ; PIC: .ent fft |
| 64 | ; PIC: save $16, $17, $ra, $18, [[FS:[0-9]+]] |
| 65 | ; PIC: restore $16, $17, $ra, $18, [[FS]] |
| 66 | ; PIC: .end fft |
Reed Kotler | 0ff4001 | 2013-12-10 14:29:38 +0000 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | declare float @ff(float) #1 |
| 70 | |
| 71 | ; Function Attrs: nounwind |
| 72 | define void @vft() #0 { |
| 73 | entry: |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame^] | 74 | %0 = load float, float* @x, align 4 |
Reed Kotler | 0ff4001 | 2013-12-10 14:29:38 +0000 | [diff] [blame] | 75 | call void @vf(float %0) |
| 76 | ret void |
Reed Kotler | 5c29d63 | 2013-12-15 20:49:30 +0000 | [diff] [blame] | 77 | ; PIC: .ent vft |
| 78 | ; STATIC: .ent vft |
| 79 | ; PIC: save $16, $ra, [[FS:[0-9]+]] |
| 80 | ; STATIC: save $16, $ra, [[FS:[0-9]+]] |
| 81 | ; PIC: restore $16, $ra, [[FS]] |
| 82 | ; STATIC: restore $16, $ra, [[FS]] |
| 83 | ; PIC: .end vft |
| 84 | ; STATIC: .end vft |
Reed Kotler | 0ff4001 | 2013-12-10 14:29:38 +0000 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | declare void @vf(float) #1 |
| 88 | |
| 89 | attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 90 | attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 91 | |
| 92 | |