brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 54300a9 Raw
60 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=pic | FileCheck %s3 4@main_q = internal global ptr null		; <ptr> [#uses=1]5 6define void @func2() nounwind {7; CHECK-LABEL: func2:8; CHECK:       ## %bb.0: ## %entry9; CHECK-NEXT:    calll L0$pb10; CHECK-NEXT:  L0$pb:11; CHECK-NEXT:    popl %eax12; CHECK-NEXT:    leal _main_q-L0$pb(%eax), %eax13; CHECK-NEXT:    ## InlineAsm Start14; CHECK-NEXT:    movl %eax, %gs:15215; CHECK-NEXT:    ## InlineAsm End16; CHECK-NEXT:    retl17entry:18	tail call void asm "mov $1,%gs:$0", "=*m,ri,~{dirflag},~{fpsr},~{flags}"(ptr elementtype(ptr) inttoptr (i32 152 to ptr), ptr @main_q) nounwind19	ret void20}21 22; The intent of this test is to ensure that we handle blockaddress' correctly23; with "i" constraints for -m32 -fPIC.24 25define void @x() {26; CHECK-LABEL: x:27; CHECK:       ## %bb.0:28; CHECK-NEXT:    ## InlineAsm Start29; CHECK-NEXT:    ## LBB1_130; CHECK-EMPTY:31; CHECK-NEXT:    ## InlineAsm End32; CHECK-NEXT:  ## %bb.2: ## %return33; CHECK-NEXT:    retl34; CHECK-NEXT:  Ltmp0: ## Block address taken35; CHECK-NEXT:  LBB1_1: ## %overflow36; CHECK-NEXT:    ## Label of block must be emitted37; CHECK-NEXT:    retl38  callbr void asm "#  ${0:l}\0A", "!i"()39          to label %return [label %overflow]40 41overflow:42  br label %return43 44return:45  ret void46}47 48; Test unusual case of blockaddress from @x in @y's asm.49define void @y() {50; CHECK-LABEL: y:51; CHECK:       ## %bb.0:52; CHECK-NEXT:    ## InlineAsm Start53; CHECK-NEXT:    ## Ltmp054; CHECK-EMPTY:55; CHECK-NEXT:    ## InlineAsm End56; CHECK-NEXT:    retl57  call void asm "# ${0:l}\0A", "i"(ptr blockaddress(@x, %overflow))58  ret void59}60