aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/X86/x86-access-to-global.ll
blob: 9e09a035ac519c89d6ad91a2d18a4e3c85791388 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc -relocation-model=pic < %s | FileCheck %s

target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128"
target triple = "i386-unknown-linux-gnu"

@.str = external dso_local global i32

define i1 @test() {
; CHECK-LABEL: test:
; CHECK:       # %bb.0:
; CHECK-NEXT:    calll .L0$pb
; CHECK-NEXT:    .cfi_adjust_cfa_offset 4
; CHECK-NEXT:  .L0$pb:
; CHECK-NEXT:    popl %eax
; CHECK-NEXT:    .cfi_adjust_cfa_offset -4
; CHECK-NEXT:  .Ltmp0:
; CHECK-NEXT:    addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp0-.L0$pb), %eax
; CHECK-NEXT:    movl $.str@GOTOFF, %ecx
; CHECK-NEXT:    addb %al, %cl
; CHECK-NEXT:    sete %al
; CHECK-NEXT:    retl
  %i = ptrtoint ptr @.str to i8
  %p = zext i8 %i to i32
  %c = icmp eq i32 %p, 0
  ret i1 %c
}