1; RUN: llc < %s -mtriple=i386-apple-darwin10 | FileCheck %s 2; RUN: llc < %s -mtriple=i386-apple-darwin10 -regalloc=basic | FileCheck %s 3; rdar://6509240 4 5; CHECK: os_clock 6; CHECK-NOT: movaps 7 8 %0 = type { %struct.TValue } ; type %0 9 %1 = type { %struct.L_Umaxalign, i32, ptr } ; type %1 10 %struct.CallInfo = type { ptr, ptr, ptr, ptr, i32, i32 } 11 %struct.GCObject = type { %struct.lua_State } 12 %struct.L_Umaxalign = type { double } 13 %struct.Mbuffer = type { ptr, i32, i32 } 14 %struct.Node = type { %struct.TValue, %struct.TKey } 15 %struct.TKey = type { %1 } 16 %struct.TString = type { %struct.anon } 17 %struct.TValue = type { %struct.L_Umaxalign, i32 } 18 %struct.Table = type { ptr, i8, i8, i8, i8, ptr, ptr, ptr, ptr, ptr, i32 } 19 %struct.UpVal = type { ptr, i8, i8, ptr, %0 } 20 %struct.anon = type { ptr, i8, i8, i8, i32, i32 } 21 %struct.global_State = type { %struct.stringtable, ptr, ptr, i8, i8, i32, ptr, ptr, ptr, ptr, ptr, ptr, %struct.Mbuffer, i32, i32, i32, i32, i32, i32, ptr, %struct.TValue, ptr, %struct.UpVal, [9 x ptr], [17 x ptr] } 22 %struct.lua_Debug = type { i32, ptr, ptr, ptr, ptr, i32, i32, i32, i32, [60 x i8], i32 } 23 %struct.lua_State = type { ptr, i8, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i16, i16, i8, i8, i32, i32, ptr, %struct.TValue, %struct.TValue, ptr, ptr, ptr, i32 } 24 %struct.lua_longjmp = type { ptr, [18 x i32], i32 } 25 %struct.stringtable = type { ptr, i32, i32 } 26@llvm.used = appending global [1 x ptr] [ptr @os_clock], section "llvm.metadata" ; <ptr> [#uses=0] 27 28define i32 @os_clock(ptr nocapture %L) nounwind ssp { 29entry: 30 %0 = tail call i32 @"\01_clock$UNIX2003"() nounwind ; <i32> [#uses=1] 31 %1 = uitofp i32 %0 to double ; <double> [#uses=1] 32 %2 = fdiv double %1, 1.000000e+06 ; <double> [#uses=1] 33 %3 = getelementptr %struct.lua_State, ptr %L, i32 0, i32 4 ; <ptr> [#uses=3] 34 %4 = load ptr, ptr %3, align 4 ; <ptr> [#uses=2] 35 %5 = getelementptr %struct.TValue, ptr %4, i32 0, i32 0, i32 0 ; <ptr> [#uses=1] 36 store double %2, ptr %5, align 4 37 %6 = getelementptr %struct.TValue, ptr %4, i32 0, i32 1 ; <ptr> [#uses=1] 38 store i32 3, ptr %6, align 4 39 %7 = load ptr, ptr %3, align 4 ; <ptr> [#uses=1] 40 %8 = getelementptr %struct.TValue, ptr %7, i32 1 ; <ptr> [#uses=1] 41 store ptr %8, ptr %3, align 4 42 ret i32 1 43} 44 45declare i32 @"\01_clock$UNIX2003"() 46