[PATCH] D113157: [tests][X86] Merge call-structfp.ll with x32-function_pointer-3.ll

Harald van Dijk via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 3 17:38:51 PDT 2021


hvdijk created this revision.
hvdijk added a reviewer: MaskRay.
hvdijk added a project: LLVM.
Herald added a subscriber: pengfei.
hvdijk requested review of this revision.
Herald added a subscriber: llvm-commits.

As suggested by @MaskRay in D112860 <https://reviews.llvm.org/D112860>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113157

Files:
  llvm/test/CodeGen/X86/call-structfp.ll
  llvm/test/CodeGen/X86/x32-function_pointer-3.ll


Index: llvm/test/CodeGen/X86/x32-function_pointer-3.ll
===================================================================
--- llvm/test/CodeGen/X86/x32-function_pointer-3.ll
+++ llvm/test/CodeGen/X86/x32-function_pointer-3.ll
@@ -20,6 +20,7 @@
 ;    register.  We need to zero-extend %edi to %rdi before branching via %rdi.
 
 define void @bar(i64 %h.coerce) nounwind {
+; CHECK-LABEL: bar:
 entry:
   %h.sroa.0.0.extract.trunc = trunc i64 %h.coerce to i32
   %0 = inttoptr i32 %h.sroa.0.0.extract.trunc to void ()*
@@ -28,3 +29,16 @@
 ; CHECK: jmpq	*%r[[REG]]
   ret void
 }
+
+declare { i64, void ()* } @pr52357.a()
+define void @pr52357.b() {
+; CHECK-LABEL: pr52357.b:
+entry:
+  %0 = tail call { i64, void ()* } @pr52357.a()
+  %1 = extractvalue { i64, void ()* } %0, 1
+  tail call void %1()
+; CHECK: callq pr52357.a at PLT
+; CHECK: movl %edx, %e[[REG:.*]]
+; CHECK: jmpq *%r[[REG]]
+  ret void
+}
Index: llvm/test/CodeGen/X86/call-structfp.ll
===================================================================
--- llvm/test/CodeGen/X86/call-structfp.ll
+++ /dev/null
@@ -1,19 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnux32 | FileCheck %s
-declare { i64, void ()* } @f()
-define void @pr52357() {
-; CHECK-LABEL: pr52357:
-; CHECK:       # %bb.0: # %entry
-; CHECK-NEXT:    pushq %rax
-; CHECK-NEXT:    .cfi_def_cfa_offset 16
-; CHECK-NEXT:    callq f at PLT
-; CHECK-NEXT:    movl %edx, %eax
-; CHECK-NEXT:    popq %rcx
-; CHECK-NEXT:    .cfi_def_cfa_offset 8
-; CHECK-NEXT:    jmpq *%rax # TAILCALL
-entry:
-  %0 = tail call { i64, void ()* } @f()
-  %1 = extractvalue { i64, void ()* } %0, 1
-  tail call void %1()
-  ret void
-}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113157.384620.patch
Type: text/x-patch
Size: 1731 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211104/f347af95/attachment.bin>


More information about the llvm-commits mailing list