Bill Schmidt | 4a28e82 | 2013-06-13 20:23:34 +0000 | [diff] [blame] | 1 | ; RUN: llc -mcpu=pwr7 -O0 -fast-isel=false < %s | FileCheck %s |
Bill Schmidt | bbc661e | 2012-10-29 14:59:36 +0000 | [diff] [blame] | 2 | |
| 3 | ; Verify internal alignment of long double in a struct. The double |
| 4 | ; argument comes in in GPR3; GPR4 is skipped; GPRs 5 and 6 contain |
| 5 | ; the long double. Check that these are stored to proper locations |
| 6 | ; in the parameter save area and loaded from there for return in FPR1/2. |
| 7 | |
| 8 | target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64" |
| 9 | target triple = "powerpc64-unknown-linux-gnu" |
| 10 | |
| 11 | %struct.S = type { double, ppc_fp128 } |
| 12 | |
| 13 | define ppc_fp128 @test(%struct.S* byval %x) nounwind { |
| 14 | entry: |
| 15 | %b = getelementptr inbounds %struct.S* %x, i32 0, i32 1 |
| 16 | %0 = load ppc_fp128* %b, align 16 |
| 17 | ret ppc_fp128 %0 |
| 18 | } |
| 19 | |
| 20 | ; CHECK: std 6, 72(1) |
| 21 | ; CHECK: std 5, 64(1) |
| 22 | ; CHECK: std 4, 56(1) |
| 23 | ; CHECK: std 3, 48(1) |
| 24 | ; CHECK: lfd 1, 64(1) |
| 25 | ; CHECK: lfd 2, 72(1) |
| 26 | |