[llvm] [test][PAC][AArch64] Add ELF tests for subtarget-neutral codegen (PR #98020)

Daniil Kovalev via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 9 00:33:46 PDT 2024


================
@@ -1,44 +1,58 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc < %s -mtriple arm64e-apple-darwin -verify-machineinstrs -global-isel=0 | FileCheck %s
-; RUN: llc < %s -mtriple arm64e-apple-darwin -verify-machineinstrs -global-isel=1 -global-isel-abort=1 | FileCheck %s
+; RUN: llc < %s -mtriple arm64e-apple-darwin             -verify-machineinstrs \
+; RUN:   -global-isel=0 | FileCheck %s --check-prefixes=DARWIN,CHECK
+; RUN: llc < %s -mtriple arm64e-apple-darwin             -verify-machineinstrs \
+; RUN:   -global-isel=1 -global-isel-abort=1 | FileCheck %s --check-prefixes=DARWIN,CHECK
+; RUN: llc < %s -mtriple aarch64-linux-gnu -mattr=+pauth -verify-machineinstrs \
+; RUN:   -global-isel=0 | FileCheck %s --check-prefixes=ELF,CHECK
+; RUN: llc < %s -mtriple aarch64-linux-gnu -mattr=+pauth -verify-machineinstrs \
+; RUN:   -global-isel=1 -global-isel-abort=1 | FileCheck %s --check-prefixes=ELF,CHECK
 
 define i64 @test_blend(i64 %arg, i64 %arg1) {
-; CHECK-LABEL: test_blend:
-; CHECK:       ; %bb.0:
-; CHECK-NEXT:    bfi x0, x1, #48, #16
-; CHECK-NEXT:    ret
+; DARWIN-LABEL: _test_blend:
+; ELF-LABEL:    test_blend:
+; DARWIN:       ; %bb.0:
+; ELF:          // %bb.0:
+; CHECK-NEXT:     bfi x0, x1, #48, #16
+; CHECK-NEXT:     ret
   %tmp = call i64 @llvm.ptrauth.blend(i64 %arg, i64 %arg1)
   ret i64 %tmp
 }
 
 define i64 @test_blend_constant(i64 %arg) {
-; CHECK-LABEL: test_blend_constant:
-; CHECK:       ; %bb.0:
-; CHECK-NEXT:    movk x0, #12345, lsl #48
-; CHECK-NEXT:    ret
+; DARWIN-LABEL: _test_blend_constant:
----------------
kovdan01 wrote:

> Do we really need to test the platform differences? Can we use `CHECK-LABEL: test_blend_constant` and `CHECK: %bb.0` on all platforms? Same in other files.

Yes, we can. I'll follow this approach, thanks

https://github.com/llvm/llvm-project/pull/98020


More information about the llvm-commits mailing list