1; RUN: llc < %s
2; verify PR 1700 is still fixed
3; ModuleID = 'hh.c'
4target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
5target triple = "i686-apple-darwin8"
6
7define x86_fp80 @x() {
8entry:
9	%retval = alloca x86_fp80, align 16		; <x86_fp80*> [#uses=2]
10	%tmp = alloca x86_fp80, align 16		; <x86_fp80*> [#uses=2]
11	%d = alloca double, align 8		; <double*> [#uses=2]
12	%"alloca point" = bitcast i32 0 to i32		; <i32> [#uses=0]
13	store double 0.000000e+00, double* %d, align 8
14	%tmp1 = load double, double* %d, align 8		; <double> [#uses=1]
15	%tmp12 = fpext double %tmp1 to x86_fp80		; <x86_fp80> [#uses=1]
16	store x86_fp80 %tmp12, x86_fp80* %tmp, align 16
17	%tmp3 = load x86_fp80, x86_fp80* %tmp, align 16		; <x86_fp80> [#uses=1]
18	store x86_fp80 %tmp3, x86_fp80* %retval, align 16
19	br label %return
20
21return:		; preds = %entry
22	%retval4 = load x86_fp80, x86_fp80* %retval		; <x86_fp80> [#uses=1]
23	ret x86_fp80 %retval4
24}
25
26define double @y() {
27entry:
28	%retval = alloca double, align 8		; <double*> [#uses=2]
29	%tmp = alloca double, align 8		; <double*> [#uses=2]
30	%ld = alloca x86_fp80, align 16		; <x86_fp80*> [#uses=2]
31	%"alloca point" = bitcast i32 0 to i32		; <i32> [#uses=0]
32	store x86_fp80 0xK00000000000000000000, x86_fp80* %ld, align 16
33	%tmp1 = load x86_fp80, x86_fp80* %ld, align 16		; <x86_fp80> [#uses=1]
34	%tmp12 = fptrunc x86_fp80 %tmp1 to double		; <double> [#uses=1]
35	store double %tmp12, double* %tmp, align 8
36	%tmp3 = load double, double* %tmp, align 8		; <double> [#uses=1]
37	store double %tmp3, double* %retval, align 8
38	br label %return
39
40return:		; preds = %entry
41	%retval4 = load double, double* %retval		; <double> [#uses=1]
42	ret double %retval4
43}
44