[TwoAddressInstructionPass] When looking for a 3 addr conversion after commuting...
[oota-llvm.git] / test / CodeGen / X86 / 2008-04-16-ReMatBug.ll
1 ; RUN: llc < %s -mtriple=i386-apple-darwin -disable-cgp-branch-opts | grep movw | not grep ", %e"
2
3         %struct.DBC_t = type { i32, i8*, i16, %struct.DBC_t*, i8*, i8*, i8*, i8*, i8*, %struct.DBC_t*, i32, i32, i32, i32, i8*, i8*, i8*, i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i16, i16, i32*, i8, i16, %struct.DRVOPT*, i16 }
4         %struct.DRVOPT = type { i16, i32, i8, %struct.DRVOPT* }
5         %struct.GENV_t = type { i32, i8*, i16, i8*, i8*, i32, i32, i32, i32, %struct.DBC_t*, i16 }
6         %struct.pthread_mutex_t = type { i32, [40 x i8] }
7 @iodbcdm_global_lock = external global %struct.pthread_mutex_t          ; <%struct.pthread_mutex_t*> [#uses=1]
8
9 define i16 @SQLDriversW(i8* %henv, i16 zeroext  %fDir, i32* %szDrvDesc, i16 signext  %cbDrvDescMax, i16* %pcbDrvDesc, i32* %szDrvAttr, i16 signext  %cbDrvAttrMax, i16* %pcbDrvAttr) nounwind  {
10 entry:
11         %tmp12 = bitcast i8* %henv to %struct.GENV_t*           ; <%struct.GENV_t*> [#uses=1]
12         br i1 true, label %bb28, label %bb
13 bb:             ; preds = %entry
14         ret i16 0
15 bb28:           ; preds = %entry
16         br i1 false, label %bb37, label %done
17 bb37:           ; preds = %bb28
18         %tmp46 = getelementptr %struct.GENV_t, %struct.GENV_t* %tmp12, i32 0, i32 10            ; <i16*> [#uses=1]
19         store i16 0, i16* %tmp46, align 4
20         br i1 false, label %bb74, label %bb92
21 bb74:           ; preds = %bb37
22         br label %bb92
23 bb92:           ; preds = %bb74, %bb37
24         %tmp95180 = shl i16 %cbDrvAttrMax, 2            ; <i16> [#uses=1]
25         %tmp100178 = shl i16 %cbDrvDescMax, 2           ; <i16> [#uses=1]
26         %tmp113 = tail call i16 @SQLDrivers_Internal( i8* %henv, i16 zeroext  %fDir, i8* null, i16 signext  %tmp100178, i16* %pcbDrvDesc, i8* null, i16 signext  %tmp95180, i16* %pcbDrvAttr, i8 zeroext  87 )  nounwind                ; <i16> [#uses=1]
27         br i1 false, label %done, label %bb137
28 bb137:          ; preds = %bb92
29         ret i16 0
30 done:           ; preds = %bb92, %bb28
31         %retcode.0 = phi i16 [ -2, %bb28 ], [ %tmp113, %bb92 ]          ; <i16> [#uses=2]
32         br i1 false, label %bb167, label %bb150
33 bb150:          ; preds = %done
34         %tmp157158 = sext i16 %retcode.0 to i32         ; <i32> [#uses=1]
35         tail call void @trace_SQLDriversW( i32 1, i32 %tmp157158, i8* %henv, i16 zeroext  %fDir, i32* %szDrvDesc, i16 signext  %cbDrvDescMax, i16* %pcbDrvDesc, i32* %szDrvAttr, i16 signext  %cbDrvAttrMax, i16* %pcbDrvAttr ) nounwind 
36         ret i16 0
37 bb167:          ; preds = %done
38         %tmp168 = tail call i32 @pthread_mutex_unlock( %struct.pthread_mutex_t* @iodbcdm_global_lock ) nounwind                 ; <i32> [#uses=0]
39         ret i16 %retcode.0
40 }
41
42 declare i32 @pthread_mutex_unlock(%struct.pthread_mutex_t*)
43
44 declare i16 @SQLDrivers_Internal(i8*, i16 zeroext , i8*, i16 signext , i16*, i8*, i16 signext , i16*, i8 zeroext )  nounwind 
45
46 declare void @trace_SQLDriversW(i32, i32, i8*, i16 zeroext , i32*, i16 signext , i16*, i32*, i16 signext , i16*)