~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to test/CodeGen/AArch64/stack-guard-remat-bitcast.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2015-07-15 17:51:08 UTC
  • Revision ID: package-import@ubuntu.com-20150715175108-l8mynwovkx4zx697
Tags: upstream-3.7~+rc2
ImportĀ upstreamĀ versionĀ 3.7~+rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; RUN: llc < %s -mtriple=arm64-apple-ios -relocation-model=pic | FileCheck %s
 
2
 
 
3
@__stack_chk_guard = external global i64*
 
4
 
 
5
; PR20558
 
6
 
 
7
; CHECK: adrp [[R0:x[0-9]+]], ___stack_chk_guard@GOTPAGE
 
8
; CHECK: ldr  [[R1:x[0-9]+]], {{\[}}[[R0]], ___stack_chk_guard@GOTPAGEOFF{{\]}}
 
9
; CHECK: ldr  [[R2:x[0-9]+]], {{\[}}[[R1]]{{\]}}
 
10
; CHECK: stur [[R2]], {{\[}}x29, [[SLOT0:[0-9#\-]+]]{{\]}}
 
11
; CHECK: ldur [[R3:x[0-9]+]], {{\[}}x29, [[SLOT0]]{{\]}}
 
12
; CHECK: sub  [[R4:x[0-9]+]], [[R2]], [[R3]]
 
13
; CHECK: cbnz [[R4]], LBB
 
14
 
 
15
define i32 @test_stack_guard_remat2() {
 
16
entry:
 
17
  %StackGuardSlot = alloca i8*
 
18
  %StackGuard = load i8*, i8** bitcast (i64** @__stack_chk_guard to i8**)
 
19
  call void @llvm.stackprotector(i8* %StackGuard, i8** %StackGuardSlot)
 
20
  %container = alloca [32 x i8], align 1
 
21
  call void @llvm.stackprotectorcheck(i8** bitcast (i64** @__stack_chk_guard to i8**))
 
22
  ret i32 -1
 
23
}
 
24
 
 
25
declare void @llvm.stackprotector(i8*, i8**)
 
26
declare void @llvm.stackprotectorcheck(i8**)