| OLD | NEW | 
|   1 ; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu -relocation-model=pic -enable
    -pie \ |   1 ; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu -relocation-model=pic -enable
    -pie \ | 
|   2 ; RUN:   | FileCheck -check-prefix=X32 %s |   2 ; RUN:   | FileCheck -check-prefix=X32 %s | 
|   3 ; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu -relocation-model=pic -e
    nable-pie \ |   3 ; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu -relocation-model=pic -e
    nable-pie \ | 
|   4 ; RUN:   | FileCheck -check-prefix=X64 %s |   4 ; RUN:   | FileCheck -check-prefix=X64 %s | 
|   5  |   5  | 
|   6 @i = thread_local global i32 15 |   6 @i = thread_local global i32 15 | 
|   7 @i2 = external thread_local global i32 |   7 @i2 = external thread_local global i32 | 
|   8  |   8  | 
|   9 define i32 @f1() { |   9 define i32 @f1() { | 
|  10 ; X32: f1: |  10 ; X32: f1: | 
| (...skipping 22 matching lines...) Expand all  Loading... | 
|  33         ret i32* @i |  33         ret i32* @i | 
|  34 } |  34 } | 
|  35  |  35  | 
|  36 define i32 @f3() { |  36 define i32 @f3() { | 
|  37 ; X32: f3: |  37 ; X32: f3: | 
|  38 ; X32:      calll .L{{[0-9]+}}$pb |  38 ; X32:      calll .L{{[0-9]+}}$pb | 
|  39 ; X32-NEXT: .L{{[0-9]+}}$pb: |  39 ; X32-NEXT: .L{{[0-9]+}}$pb: | 
|  40 ; X32-NEXT: popl %eax |  40 ; X32-NEXT: popl %eax | 
|  41 ; X32-NEXT: .Ltmp{{[0-9]+}}: |  41 ; X32-NEXT: .Ltmp{{[0-9]+}}: | 
|  42 ; X32-NEXT: addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp{{[0-9]+}}-.L{{[0-9]+}}$pb), %eax |  42 ; X32-NEXT: addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp{{[0-9]+}}-.L{{[0-9]+}}$pb), %eax | 
|  43 ; X32-NEXT: movl %gs:i2@GOTNTPOFF(%eax), %eax |  43 ; X32-NEXT: movl i2@GOTNTPOFF(%eax), %eax | 
 |  44 ; X32-NEXT: movl %gs:(%eax), %eax | 
|  44 ; X32-NEXT: ret |  45 ; X32-NEXT: ret | 
|  45 ; X64: f3: |  46 ; X64: f3: | 
|  46 ; X64:      movq i2@GOTTPOFF(%rip), %rax |  47 ; X64:      movq i2@GOTTPOFF(%rip), %rax | 
|  47 ; X64-NEXT: movl %fs:(%rax), %eax |  48 ; X64-NEXT: movl %fs:(%rax), %eax | 
|  48 ; X64-NEXT: ret |  49 ; X64-NEXT: ret | 
|  49  |  50  | 
|  50 entry: |  51 entry: | 
|  51         %tmp1 = load i32* @i2 |  52         %tmp1 = load i32* @i2 | 
|  52         ret i32 %tmp1 |  53         ret i32 %tmp1 | 
|  53 } |  54 } | 
|  54  |  55  | 
|  55 define i32* @f4() { |  56 define i32* @f4() { | 
|  56 ; X32: f4: |  57 ; X32: f4: | 
|  57 ; X32:      calll .L{{[0-9]+}}$pb |  58 ; X32:      calll .L{{[0-9]+}}$pb | 
|  58 ; X32-NEXT: .L{{[0-9]+}}$pb: |  59 ; X32-NEXT: .L{{[0-9]+}}$pb: | 
|  59 ; X32-NEXT: popl %eax |  60 ; X32-NEXT: popl %ecx | 
|  60 ; X32-NEXT: .Ltmp{{[0-9]+}}: |  61 ; X32-NEXT: .Ltmp{{[0-9]+}}: | 
|  61 ; X32-NEXT: addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp{{[0-9]+}}-.L{{[0-9]+}}$pb), %eax |  62 ; X32-NEXT: addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp{{[0-9]+}}-.L{{[0-9]+}}$pb), %ecx | 
|  62 ; X32-NEXT: leal i2@GOTNTPOFF(%eax), %eax |  63 ; X32-NEXT: movl %gs:0, %eax | 
|  63 ; X32-NEXT: addl %gs:0, %eax |  64 ; X32-NEXT: addl i2@GOTNTPOFF(%ecx), %eax | 
|  64 ; X32-NEXT: ret |  65 ; X32-NEXT: ret | 
|  65 ; X64: f4: |  66 ; X64: f4: | 
|  66 ; X64:      movq %fs:0, %rax |  67 ; X64:      movq %fs:0, %rax | 
|  67 ; X64-NEXT: addq i2@GOTTPOFF(%rip), %rax |  68 ; X64-NEXT: addq i2@GOTTPOFF(%rip), %rax | 
|  68 ; X64-NEXT: ret |  69 ; X64-NEXT: ret | 
|  69  |  70  | 
|  70 entry: |  71 entry: | 
|  71         ret i32* @i2 |  72         ret i32* @i2 | 
|  72 } |  73 } | 
| OLD | NEW |