1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu | FileCheck -check-prefix=X32_LINUX %s 2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu | FileCheck -check-prefix=X64_LINUX %s 3*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=x86 -mtriple=x86-pc-win32 | FileCheck -check-prefix=X32_WIN %s 4*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=x86-64 -mtriple=x86_64-pc-win32 | FileCheck -check-prefix=X64_WIN %s 5*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=x86 -mtriple=x86-pc-windows-gnu | FileCheck -check-prefix=MINGW32 %s 6*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=x86-64 -mtriple=x86_64-pc-windows-gnu | FileCheck -check-prefix=X64_WIN %s 7*9880d681SAndroid Build Coastguard Worker 8*9880d681SAndroid Build Coastguard Worker@i1 = thread_local global i32 15 9*9880d681SAndroid Build Coastguard Worker@i2 = external thread_local global i32 10*9880d681SAndroid Build Coastguard Worker@i3 = internal thread_local global i32 15 11*9880d681SAndroid Build Coastguard Worker@i4 = hidden thread_local global i32 15 12*9880d681SAndroid Build Coastguard Worker@i5 = external hidden thread_local global i32 13*9880d681SAndroid Build Coastguard Worker@i6 = external protected thread_local global i32 14*9880d681SAndroid Build Coastguard Worker@s1 = thread_local global i16 15 15*9880d681SAndroid Build Coastguard Worker@b1 = thread_local global i8 0 16*9880d681SAndroid Build Coastguard Worker@b2 = thread_local(localexec) global i8 0 17*9880d681SAndroid Build Coastguard Worker 18*9880d681SAndroid Build Coastguard Workerdefine i32 @f1() { 19*9880d681SAndroid Build Coastguard Worker; X32_LINUX-LABEL: f1: 20*9880d681SAndroid Build Coastguard Worker; X32_LINUX: movl %gs:i1@NTPOFF, %eax 21*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: ret 22*9880d681SAndroid Build Coastguard Worker; X64_LINUX-LABEL: f1: 23*9880d681SAndroid Build Coastguard Worker; X64_LINUX: movl %fs:i1@TPOFF, %eax 24*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: ret 25*9880d681SAndroid Build Coastguard Worker; X32_WIN-LABEL: f1: 26*9880d681SAndroid Build Coastguard Worker; X32_WIN: movl __tls_index, %eax 27*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl %fs:__tls_array, %ecx 28*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl (%ecx,%eax,4), %eax 29*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl _i1@SECREL32(%eax), %eax 30*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: ret 31*9880d681SAndroid Build Coastguard Worker; X64_WIN-LABEL: f1: 32*9880d681SAndroid Build Coastguard Worker; X64_WIN: movl _tls_index(%rip), %eax 33*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq %gs:88, %rcx 34*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq (%rcx,%rax,8), %rax 35*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movl i1@SECREL32(%rax), %eax 36*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: ret 37*9880d681SAndroid Build Coastguard Worker; MINGW32-LABEL: _f1: 38*9880d681SAndroid Build Coastguard Worker; MINGW32: movl __tls_index, %eax 39*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl %fs:44, %ecx 40*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl (%ecx,%eax,4), %eax 41*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl _i1@SECREL32(%eax), %eax 42*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: retl 43*9880d681SAndroid Build Coastguard Worker 44*9880d681SAndroid Build Coastguard Workerentry: 45*9880d681SAndroid Build Coastguard Worker %tmp1 = load i32, i32* @i1 46*9880d681SAndroid Build Coastguard Worker ret i32 %tmp1 47*9880d681SAndroid Build Coastguard Worker} 48*9880d681SAndroid Build Coastguard Worker 49*9880d681SAndroid Build Coastguard Workerdefine i32* @f2() { 50*9880d681SAndroid Build Coastguard Worker; X32_LINUX-LABEL: f2: 51*9880d681SAndroid Build Coastguard Worker; X32_LINUX: movl %gs:0, %eax 52*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: leal i1@NTPOFF(%eax), %eax 53*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: ret 54*9880d681SAndroid Build Coastguard Worker; X64_LINUX-LABEL: f2: 55*9880d681SAndroid Build Coastguard Worker; X64_LINUX: movq %fs:0, %rax 56*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: leaq i1@TPOFF(%rax), %rax 57*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: ret 58*9880d681SAndroid Build Coastguard Worker; X32_WIN-LABEL: f2: 59*9880d681SAndroid Build Coastguard Worker; X32_WIN: movl __tls_index, %eax 60*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl %fs:__tls_array, %ecx 61*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl (%ecx,%eax,4), %eax 62*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: leal _i1@SECREL32(%eax), %eax 63*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: ret 64*9880d681SAndroid Build Coastguard Worker; X64_WIN-LABEL: f2: 65*9880d681SAndroid Build Coastguard Worker; X64_WIN: movl _tls_index(%rip), %eax 66*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq %gs:88, %rcx 67*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq (%rcx,%rax,8), %rax 68*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: leaq i1@SECREL32(%rax), %rax 69*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: ret 70*9880d681SAndroid Build Coastguard Worker; MINGW32-LABEL: _f2: 71*9880d681SAndroid Build Coastguard Worker; MINGW32: movl __tls_index, %eax 72*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl %fs:44, %ecx 73*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl (%ecx,%eax,4), %eax 74*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: leal _i1@SECREL32(%eax), %eax 75*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: retl 76*9880d681SAndroid Build Coastguard Worker 77*9880d681SAndroid Build Coastguard Workerentry: 78*9880d681SAndroid Build Coastguard Worker ret i32* @i1 79*9880d681SAndroid Build Coastguard Worker} 80*9880d681SAndroid Build Coastguard Worker 81*9880d681SAndroid Build Coastguard Workerdefine i32 @f3() nounwind { 82*9880d681SAndroid Build Coastguard Worker; X32_LINUX-LABEL: f3: 83*9880d681SAndroid Build Coastguard Worker; X32_LINUX: movl i2@INDNTPOFF, %eax 84*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: movl %gs:(%eax), %eax 85*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: ret 86*9880d681SAndroid Build Coastguard Worker; X64_LINUX-LABEL: f3: 87*9880d681SAndroid Build Coastguard Worker; X64_LINUX: movq i2@GOTTPOFF(%rip), %rax 88*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: movl %fs:(%rax), %eax 89*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: ret 90*9880d681SAndroid Build Coastguard Worker; X32_WIN-LABEL: f3: 91*9880d681SAndroid Build Coastguard Worker; X32_WIN: movl __tls_index, %eax 92*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl %fs:__tls_array, %ecx 93*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl (%ecx,%eax,4), %eax 94*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl _i2@SECREL32(%eax), %eax 95*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: ret 96*9880d681SAndroid Build Coastguard Worker; X64_WIN-LABEL: f3: 97*9880d681SAndroid Build Coastguard Worker; X64_WIN: movl _tls_index(%rip), %eax 98*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq %gs:88, %rcx 99*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq (%rcx,%rax,8), %rax 100*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movl i2@SECREL32(%rax), %eax 101*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: ret 102*9880d681SAndroid Build Coastguard Worker; MINGW32-LABEL: _f3: 103*9880d681SAndroid Build Coastguard Worker; MINGW32: movl __tls_index, %eax 104*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl %fs:44, %ecx 105*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl (%ecx,%eax,4), %eax 106*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl _i2@SECREL32(%eax), %eax 107*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: retl 108*9880d681SAndroid Build Coastguard Worker 109*9880d681SAndroid Build Coastguard Workerentry: 110*9880d681SAndroid Build Coastguard Worker %tmp1 = load i32, i32* @i2 111*9880d681SAndroid Build Coastguard Worker ret i32 %tmp1 112*9880d681SAndroid Build Coastguard Worker} 113*9880d681SAndroid Build Coastguard Worker 114*9880d681SAndroid Build Coastguard Workerdefine i32* @f4() { 115*9880d681SAndroid Build Coastguard Worker; X32_LINUX-LABEL: f4: 116*9880d681SAndroid Build Coastguard Worker; X32_LINUX: movl %gs:0, %eax 117*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: addl i2@INDNTPOFF, %eax 118*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: ret 119*9880d681SAndroid Build Coastguard Worker; X64_LINUX-LABEL: f4: 120*9880d681SAndroid Build Coastguard Worker; X64_LINUX: movq %fs:0, %rax 121*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: addq i2@GOTTPOFF(%rip), %rax 122*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: ret 123*9880d681SAndroid Build Coastguard Worker; X32_WIN-LABEL: f4: 124*9880d681SAndroid Build Coastguard Worker; X32_WIN: movl __tls_index, %eax 125*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl %fs:__tls_array, %ecx 126*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl (%ecx,%eax,4), %eax 127*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: leal _i2@SECREL32(%eax), %eax 128*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: ret 129*9880d681SAndroid Build Coastguard Worker; X64_WIN-LABEL: f4: 130*9880d681SAndroid Build Coastguard Worker; X64_WIN: movl _tls_index(%rip), %eax 131*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq %gs:88, %rcx 132*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq (%rcx,%rax,8), %rax 133*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: leaq i2@SECREL32(%rax), %rax 134*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: ret 135*9880d681SAndroid Build Coastguard Worker; MINGW32-LABEL: _f4: 136*9880d681SAndroid Build Coastguard Worker; MINGW32: movl __tls_index, %eax 137*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl %fs:44, %ecx 138*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl (%ecx,%eax,4), %eax 139*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: leal _i2@SECREL32(%eax), %eax 140*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: retl 141*9880d681SAndroid Build Coastguard Worker 142*9880d681SAndroid Build Coastguard Workerentry: 143*9880d681SAndroid Build Coastguard Worker ret i32* @i2 144*9880d681SAndroid Build Coastguard Worker} 145*9880d681SAndroid Build Coastguard Worker 146*9880d681SAndroid Build Coastguard Workerdefine i32 @f5() nounwind { 147*9880d681SAndroid Build Coastguard Worker; X32_LINUX-LABEL: f5: 148*9880d681SAndroid Build Coastguard Worker; X32_LINUX: movl %gs:i3@NTPOFF, %eax 149*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: ret 150*9880d681SAndroid Build Coastguard Worker; X64_LINUX-LABEL: f5: 151*9880d681SAndroid Build Coastguard Worker; X64_LINUX: movl %fs:i3@TPOFF, %eax 152*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: ret 153*9880d681SAndroid Build Coastguard Worker; X32_WIN-LABEL: f5: 154*9880d681SAndroid Build Coastguard Worker; X32_WIN: movl __tls_index, %eax 155*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl %fs:__tls_array, %ecx 156*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl (%ecx,%eax,4), %eax 157*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl _i3@SECREL32(%eax), %eax 158*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: ret 159*9880d681SAndroid Build Coastguard Worker; X64_WIN-LABEL: f5: 160*9880d681SAndroid Build Coastguard Worker; X64_WIN: movl _tls_index(%rip), %eax 161*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq %gs:88, %rcx 162*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq (%rcx,%rax,8), %rax 163*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movl i3@SECREL32(%rax), %eax 164*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: ret 165*9880d681SAndroid Build Coastguard Worker; MINGW32-LABEL: _f5: 166*9880d681SAndroid Build Coastguard Worker; MINGW32: movl __tls_index, %eax 167*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl %fs:44, %ecx 168*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl (%ecx,%eax,4), %eax 169*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl _i3@SECREL32(%eax), %eax 170*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: retl 171*9880d681SAndroid Build Coastguard Worker 172*9880d681SAndroid Build Coastguard Workerentry: 173*9880d681SAndroid Build Coastguard Worker %tmp1 = load i32, i32* @i3 174*9880d681SAndroid Build Coastguard Worker ret i32 %tmp1 175*9880d681SAndroid Build Coastguard Worker} 176*9880d681SAndroid Build Coastguard Worker 177*9880d681SAndroid Build Coastguard Workerdefine i32* @f6() { 178*9880d681SAndroid Build Coastguard Worker; X32_LINUX-LABEL: f6: 179*9880d681SAndroid Build Coastguard Worker; X32_LINUX: movl %gs:0, %eax 180*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: leal i3@NTPOFF(%eax), %eax 181*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: ret 182*9880d681SAndroid Build Coastguard Worker; X64_LINUX-LABEL: f6: 183*9880d681SAndroid Build Coastguard Worker; X64_LINUX: movq %fs:0, %rax 184*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: leaq i3@TPOFF(%rax), %rax 185*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: ret 186*9880d681SAndroid Build Coastguard Worker; X32_WIN-LABEL: f6: 187*9880d681SAndroid Build Coastguard Worker; X32_WIN: movl __tls_index, %eax 188*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl %fs:__tls_array, %ecx 189*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl (%ecx,%eax,4), %eax 190*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: leal _i3@SECREL32(%eax), %eax 191*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: ret 192*9880d681SAndroid Build Coastguard Worker; X64_WIN-LABEL: f6: 193*9880d681SAndroid Build Coastguard Worker; X64_WIN: movl _tls_index(%rip), %eax 194*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq %gs:88, %rcx 195*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq (%rcx,%rax,8), %rax 196*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: leaq i3@SECREL32(%rax), %rax 197*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: ret 198*9880d681SAndroid Build Coastguard Worker; MINGW32-LABEL: _f6: 199*9880d681SAndroid Build Coastguard Worker; MINGW32: movl __tls_index, %eax 200*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl %fs:44, %ecx 201*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl (%ecx,%eax,4), %eax 202*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: leal _i3@SECREL32(%eax), %eax 203*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: retl 204*9880d681SAndroid Build Coastguard Worker 205*9880d681SAndroid Build Coastguard Workerentry: 206*9880d681SAndroid Build Coastguard Worker ret i32* @i3 207*9880d681SAndroid Build Coastguard Worker} 208*9880d681SAndroid Build Coastguard Worker 209*9880d681SAndroid Build Coastguard Workerdefine i32 @f7() { 210*9880d681SAndroid Build Coastguard Worker; X32_LINUX-LABEL: f7: 211*9880d681SAndroid Build Coastguard Worker; X32_LINUX: movl %gs:i4@NTPOFF, %eax 212*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: ret 213*9880d681SAndroid Build Coastguard Worker; X64_LINUX-LABEL: f7: 214*9880d681SAndroid Build Coastguard Worker; X64_LINUX: movl %fs:i4@TPOFF, %eax 215*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: ret 216*9880d681SAndroid Build Coastguard Worker; MINGW32-LABEL: _f7: 217*9880d681SAndroid Build Coastguard Worker; MINGW32: movl __tls_index, %eax 218*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl %fs:44, %ecx 219*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl (%ecx,%eax,4), %eax 220*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl _i4@SECREL32(%eax), %eax 221*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: retl 222*9880d681SAndroid Build Coastguard Worker 223*9880d681SAndroid Build Coastguard Workerentry: 224*9880d681SAndroid Build Coastguard Worker %tmp1 = load i32, i32* @i4 225*9880d681SAndroid Build Coastguard Worker ret i32 %tmp1 226*9880d681SAndroid Build Coastguard Worker} 227*9880d681SAndroid Build Coastguard Worker 228*9880d681SAndroid Build Coastguard Workerdefine i32* @f8() { 229*9880d681SAndroid Build Coastguard Worker; X32_LINUX-LABEL: f8: 230*9880d681SAndroid Build Coastguard Worker; X32_LINUX: movl %gs:0, %eax 231*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: leal i4@NTPOFF(%eax), %eax 232*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: ret 233*9880d681SAndroid Build Coastguard Worker; X64_LINUX-LABEL: f8: 234*9880d681SAndroid Build Coastguard Worker; X64_LINUX: movq %fs:0, %rax 235*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: leaq i4@TPOFF(%rax), %rax 236*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: ret 237*9880d681SAndroid Build Coastguard Worker; MINGW32-LABEL: _f8: 238*9880d681SAndroid Build Coastguard Worker; MINGW32: movl __tls_index, %eax 239*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl %fs:44, %ecx 240*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl (%ecx,%eax,4), %eax 241*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: leal _i4@SECREL32(%eax), %eax 242*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: retl 243*9880d681SAndroid Build Coastguard Worker 244*9880d681SAndroid Build Coastguard Workerentry: 245*9880d681SAndroid Build Coastguard Worker ret i32* @i4 246*9880d681SAndroid Build Coastguard Worker} 247*9880d681SAndroid Build Coastguard Worker 248*9880d681SAndroid Build Coastguard Workerdefine i32 @f9() { 249*9880d681SAndroid Build Coastguard Worker; X32_LINUX-LABEL: f9: 250*9880d681SAndroid Build Coastguard Worker; X32_LINUX: movl %gs:i5@NTPOFF, %eax 251*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: ret 252*9880d681SAndroid Build Coastguard Worker; X64_LINUX-LABEL: f9: 253*9880d681SAndroid Build Coastguard Worker; X64_LINUX: movl %fs:i5@TPOFF, %eax 254*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: ret 255*9880d681SAndroid Build Coastguard Worker; MINGW32-LABEL: _f9: 256*9880d681SAndroid Build Coastguard Worker; MINGW32: movl __tls_index, %eax 257*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl %fs:44, %ecx 258*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl (%ecx,%eax,4), %eax 259*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl _i5@SECREL32(%eax), %eax 260*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: retl 261*9880d681SAndroid Build Coastguard Worker 262*9880d681SAndroid Build Coastguard Workerentry: 263*9880d681SAndroid Build Coastguard Worker %tmp1 = load i32, i32* @i5 264*9880d681SAndroid Build Coastguard Worker ret i32 %tmp1 265*9880d681SAndroid Build Coastguard Worker} 266*9880d681SAndroid Build Coastguard Worker 267*9880d681SAndroid Build Coastguard Workerdefine i32* @f10() { 268*9880d681SAndroid Build Coastguard Worker; X32_LINUX-LABEL: f10: 269*9880d681SAndroid Build Coastguard Worker; X32_LINUX: movl %gs:0, %eax 270*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: leal i5@NTPOFF(%eax), %eax 271*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: ret 272*9880d681SAndroid Build Coastguard Worker; X64_LINUX-LABEL: f10: 273*9880d681SAndroid Build Coastguard Worker; X64_LINUX: movq %fs:0, %rax 274*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: leaq i5@TPOFF(%rax), %rax 275*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: ret 276*9880d681SAndroid Build Coastguard Worker; MINGW32-LABEL: _f10: 277*9880d681SAndroid Build Coastguard Worker; MINGW32: movl __tls_index, %eax 278*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl %fs:44, %ecx 279*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl (%ecx,%eax,4), %eax 280*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: leal _i5@SECREL32(%eax), %eax 281*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: retl 282*9880d681SAndroid Build Coastguard Worker 283*9880d681SAndroid Build Coastguard Workerentry: 284*9880d681SAndroid Build Coastguard Worker ret i32* @i5 285*9880d681SAndroid Build Coastguard Worker} 286*9880d681SAndroid Build Coastguard Worker 287*9880d681SAndroid Build Coastguard Workerdefine i16 @f11() { 288*9880d681SAndroid Build Coastguard Worker; X32_LINUX-LABEL: f11: 289*9880d681SAndroid Build Coastguard Worker; X32_LINUX: movzwl %gs:s1@NTPOFF, %eax 290*9880d681SAndroid Build Coastguard Worker; X32_LINUX: ret 291*9880d681SAndroid Build Coastguard Worker; X64_LINUX-LABEL: f11: 292*9880d681SAndroid Build Coastguard Worker; X64_LINUX: movzwl %fs:s1@TPOFF, %eax 293*9880d681SAndroid Build Coastguard Worker; X64_LINUX: ret 294*9880d681SAndroid Build Coastguard Worker; X32_WIN-LABEL: f11: 295*9880d681SAndroid Build Coastguard Worker; X32_WIN: movl __tls_index, %eax 296*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl %fs:__tls_array, %ecx 297*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl (%ecx,%eax,4), %eax 298*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movzwl _s1@SECREL32(%eax), %eax 299*9880d681SAndroid Build Coastguard Worker; X32_WIN: ret 300*9880d681SAndroid Build Coastguard Worker; X64_WIN-LABEL: f11: 301*9880d681SAndroid Build Coastguard Worker; X64_WIN: movl _tls_index(%rip), %eax 302*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq %gs:88, %rcx 303*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq (%rcx,%rax,8), %rax 304*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movzwl s1@SECREL32(%rax), %eax 305*9880d681SAndroid Build Coastguard Worker; X64_WIN: ret 306*9880d681SAndroid Build Coastguard Worker; MINGW32-LABEL: _f11: 307*9880d681SAndroid Build Coastguard Worker; MINGW32: movl __tls_index, %eax 308*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl %fs:44, %ecx 309*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl (%ecx,%eax,4), %eax 310*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movzwl _s1@SECREL32(%eax), %eax 311*9880d681SAndroid Build Coastguard Worker; MINGW32: retl 312*9880d681SAndroid Build Coastguard Worker 313*9880d681SAndroid Build Coastguard Workerentry: 314*9880d681SAndroid Build Coastguard Worker %tmp1 = load i16, i16* @s1 315*9880d681SAndroid Build Coastguard Worker ret i16 %tmp1 316*9880d681SAndroid Build Coastguard Worker} 317*9880d681SAndroid Build Coastguard Worker 318*9880d681SAndroid Build Coastguard Workerdefine i32 @f12() { 319*9880d681SAndroid Build Coastguard Worker; X32_LINUX-LABEL: f12: 320*9880d681SAndroid Build Coastguard Worker; X32_LINUX: movswl %gs:s1@NTPOFF, %eax 321*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: ret 322*9880d681SAndroid Build Coastguard Worker; X64_LINUX-LABEL: f12: 323*9880d681SAndroid Build Coastguard Worker; X64_LINUX: movswl %fs:s1@TPOFF, %eax 324*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: ret 325*9880d681SAndroid Build Coastguard Worker; X32_WIN-LABEL: f12: 326*9880d681SAndroid Build Coastguard Worker; X32_WIN: movl __tls_index, %eax 327*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl %fs:__tls_array, %ecx 328*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl (%ecx,%eax,4), %eax 329*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movswl _s1@SECREL32(%eax), %eax 330*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: ret 331*9880d681SAndroid Build Coastguard Worker; X64_WIN-LABEL: f12: 332*9880d681SAndroid Build Coastguard Worker; X64_WIN: movl _tls_index(%rip), %eax 333*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq %gs:88, %rcx 334*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq (%rcx,%rax,8), %rax 335*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movswl s1@SECREL32(%rax), %eax 336*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: ret 337*9880d681SAndroid Build Coastguard Worker; MINGW32-LABEL: _f12: 338*9880d681SAndroid Build Coastguard Worker; MINGW32: movl __tls_index, %eax 339*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl %fs:44, %ecx 340*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl (%ecx,%eax,4), %eax 341*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movswl _s1@SECREL32(%eax), %eax 342*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: retl 343*9880d681SAndroid Build Coastguard Worker 344*9880d681SAndroid Build Coastguard Worker 345*9880d681SAndroid Build Coastguard Workerentry: 346*9880d681SAndroid Build Coastguard Worker %tmp1 = load i16, i16* @s1 347*9880d681SAndroid Build Coastguard Worker %tmp2 = sext i16 %tmp1 to i32 348*9880d681SAndroid Build Coastguard Worker ret i32 %tmp2 349*9880d681SAndroid Build Coastguard Worker} 350*9880d681SAndroid Build Coastguard Worker 351*9880d681SAndroid Build Coastguard Workerdefine i8 @f13() { 352*9880d681SAndroid Build Coastguard Worker; X32_LINUX-LABEL: f13: 353*9880d681SAndroid Build Coastguard Worker; X32_LINUX: movb %gs:b1@NTPOFF, %al 354*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: ret 355*9880d681SAndroid Build Coastguard Worker; X64_LINUX-LABEL: f13: 356*9880d681SAndroid Build Coastguard Worker; X64_LINUX: movb %fs:b1@TPOFF, %al 357*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: ret 358*9880d681SAndroid Build Coastguard Worker; X32_WIN-LABEL: f13: 359*9880d681SAndroid Build Coastguard Worker; X32_WIN: movl __tls_index, %eax 360*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl %fs:__tls_array, %ecx 361*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl (%ecx,%eax,4), %eax 362*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movb _b1@SECREL32(%eax), %al 363*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: ret 364*9880d681SAndroid Build Coastguard Worker; X64_WIN-LABEL: f13: 365*9880d681SAndroid Build Coastguard Worker; X64_WIN: movl _tls_index(%rip), %eax 366*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq %gs:88, %rcx 367*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq (%rcx,%rax,8), %rax 368*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movb b1@SECREL32(%rax), %al 369*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: ret 370*9880d681SAndroid Build Coastguard Worker; MINGW32-LABEL: _f13: 371*9880d681SAndroid Build Coastguard Worker; MINGW32: movl __tls_index, %eax 372*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl %fs:44, %ecx 373*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl (%ecx,%eax,4), %eax 374*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movb _b1@SECREL32(%eax), %al 375*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: retl 376*9880d681SAndroid Build Coastguard Worker 377*9880d681SAndroid Build Coastguard Workerentry: 378*9880d681SAndroid Build Coastguard Worker %tmp1 = load i8, i8* @b1 379*9880d681SAndroid Build Coastguard Worker ret i8 %tmp1 380*9880d681SAndroid Build Coastguard Worker} 381*9880d681SAndroid Build Coastguard Worker 382*9880d681SAndroid Build Coastguard Workerdefine i32 @f14() { 383*9880d681SAndroid Build Coastguard Worker; X32_LINUX-LABEL: f14: 384*9880d681SAndroid Build Coastguard Worker; X32_LINUX: movsbl %gs:b1@NTPOFF, %eax 385*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: ret 386*9880d681SAndroid Build Coastguard Worker; X64_LINUX-LABEL: f14: 387*9880d681SAndroid Build Coastguard Worker; X64_LINUX: movsbl %fs:b1@TPOFF, %eax 388*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: ret 389*9880d681SAndroid Build Coastguard Worker; X32_WIN-LABEL: f14: 390*9880d681SAndroid Build Coastguard Worker; X32_WIN: movl __tls_index, %eax 391*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl %fs:__tls_array, %ecx 392*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl (%ecx,%eax,4), %eax 393*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movsbl _b1@SECREL32(%eax), %eax 394*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: ret 395*9880d681SAndroid Build Coastguard Worker; X64_WIN-LABEL: f14: 396*9880d681SAndroid Build Coastguard Worker; X64_WIN: movl _tls_index(%rip), %eax 397*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq %gs:88, %rcx 398*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq (%rcx,%rax,8), %rax 399*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movsbl b1@SECREL32(%rax), %eax 400*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: ret 401*9880d681SAndroid Build Coastguard Worker; MINGW32-LABEL: _f14: 402*9880d681SAndroid Build Coastguard Worker; MINGW32: movl __tls_index, %eax 403*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl %fs:44, %ecx 404*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl (%ecx,%eax,4), %eax 405*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movsbl _b1@SECREL32(%eax), %eax 406*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: retl 407*9880d681SAndroid Build Coastguard Worker 408*9880d681SAndroid Build Coastguard Workerentry: 409*9880d681SAndroid Build Coastguard Worker %tmp1 = load i8, i8* @b1 410*9880d681SAndroid Build Coastguard Worker %tmp2 = sext i8 %tmp1 to i32 411*9880d681SAndroid Build Coastguard Worker ret i32 %tmp2 412*9880d681SAndroid Build Coastguard Worker} 413*9880d681SAndroid Build Coastguard Worker 414*9880d681SAndroid Build Coastguard Workerdefine i8* @f15() { 415*9880d681SAndroid Build Coastguard Worker; X32_LINUX-LABEL: f15: 416*9880d681SAndroid Build Coastguard Worker; X32_LINUX: movl %gs:0, %eax 417*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: leal b2@NTPOFF(%eax), %eax 418*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: ret 419*9880d681SAndroid Build Coastguard Worker; X64_LINUX-LABEL: f15: 420*9880d681SAndroid Build Coastguard Worker; X64_LINUX: movq %fs:0, %rax 421*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: leaq b2@TPOFF(%rax), %rax 422*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: ret 423*9880d681SAndroid Build Coastguard Worker; X32_WIN-LABEL: f15: 424*9880d681SAndroid Build Coastguard Worker; X32_WIN: movl %fs:__tls_array, %eax 425*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: movl (%eax), %eax 426*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: leal _b2@SECREL32(%eax), %eax 427*9880d681SAndroid Build Coastguard Worker; X32_WIN-NEXT: ret 428*9880d681SAndroid Build Coastguard Worker; X64_WIN-LABEL: f15: 429*9880d681SAndroid Build Coastguard Worker; X64_WIN: movq %gs:88, %rax 430*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: movq (%rax), %rax 431*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: leaq b2@SECREL32(%rax), %rax 432*9880d681SAndroid Build Coastguard Worker; X64_WIN-NEXT: ret 433*9880d681SAndroid Build Coastguard Worker; MINGW32-LABEL: f15: 434*9880d681SAndroid Build Coastguard Worker; MINGW32: movl %fs:44, %eax 435*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: movl (%eax), %eax 436*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: leal _b2@SECREL32(%eax), %eax 437*9880d681SAndroid Build Coastguard Worker; MINGW32-NEXT: ret 438*9880d681SAndroid Build Coastguard Workerentry: 439*9880d681SAndroid Build Coastguard Worker ret i8* @b2 440*9880d681SAndroid Build Coastguard Worker} 441*9880d681SAndroid Build Coastguard Worker 442*9880d681SAndroid Build Coastguard Worker 443*9880d681SAndroid Build Coastguard Workerdefine i32* @f16() { 444*9880d681SAndroid Build Coastguard Worker; X32_LINUX-LABEL: f16: 445*9880d681SAndroid Build Coastguard Worker; X32_LINUX: movl %gs:0, %eax 446*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: leal i6@NTPOFF(%eax), %eax 447*9880d681SAndroid Build Coastguard Worker; X32_LINUX-NEXT: ret 448*9880d681SAndroid Build Coastguard Worker 449*9880d681SAndroid Build Coastguard Worker; X64_LINUX-LABEL: f16: 450*9880d681SAndroid Build Coastguard Worker; X64_LINUX: movq %fs:0, %rax 451*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: leaq i6@TPOFF(%rax), %rax 452*9880d681SAndroid Build Coastguard Worker; X64_LINUX-NEXT: ret 453*9880d681SAndroid Build Coastguard Worker 454*9880d681SAndroid Build Coastguard Worker ret i32* @i6 455*9880d681SAndroid Build Coastguard Worker} 456