1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/CodeGen/PowerPC/2007-09-07-LoadStoreIdxForms.ll
Matthias Braun b3a8585bc1 PowerPC: Do not use llc -march in tests.
`llc -march` is problematic because it only switches the target
architecture, but leaves the operating system unchanged. This
occasionally leads to indeterministic tests because the OS from
LLVM_DEFAULT_TARGET_TRIPLE is used.

However we can simply always use `llc -mtriple` instead. This changes
all the tests to do this to avoid people using -march when they copy and
paste parts of tests.

This patch:
- Removes -march if the .ll file already has a matching `target triple`
  directive or -mtriple argument.
- In all other cases changes -march=ppc32/-march=ppc64 to
  -mtriple=ppc32--/-mtriple=ppc64--

See also the discussion in https://reviews.llvm.org/D35287

llvm-svn: 309754
2017-08-01 22:20:41 +00:00

40 lines
1.2 KiB
LLVM

; RUN: llc -verify-machineinstrs < %s -mtriple=ppc64-- -O1 | FileCheck %s
; RUN: llc -verify-machineinstrs < %s -mtriple=ppc64-- | FileCheck --check-prefix=CHECK-OPT %s
%struct.__db_region = type { %struct.__mutex_t, [4 x i8], %struct.anon, i32, [1 x i32] }
%struct.__mutex_t = type { i32 }
%struct.anon = type { i64, i64 }
define void @foo() {
entry:
%ttype = alloca i32, align 4 ; <i32*> [#uses=1]
%regs = alloca [1024 x %struct.__db_region], align 16 ; <[1024 x %struct.__db_region]*> [#uses=0]
%tmp = load i32, i32* %ttype, align 4 ; <i32> [#uses=1]
%tmp1 = call i32 (...) @bork( i32 %tmp ) ; <i32> [#uses=0]
ret void
; CHECK: @foo
; CHECK: lwzx
; CHECK: blr
; CHECK-OPT: @foo
; CHECK-OPT: lwz
; CHECK-OPT: blr
}
define signext i32 @test(i32* noalias nocapture readonly %b, i32 signext %n) {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, i32* %b, i64 %idxprom
%0 = load i32, i32* %arrayidx, align 4
%mul = mul nsw i32 %0, 7
ret i32 %mul
; CHECK-OPT: @test
; CHECK-OPT: lwzx
; CHECK-OPT: blr
}
declare i32 @bork(...)