Bjorn Pettersson 211cf8a384 [test] Use -passes in more Transforms tests
Another step towards getting rid of dependencies to the legacy
pass manager.

Primary change here is to just do -passes=foo instead of -foo in
simple situations (when running a single transform pass). But also
updated a few test running multiple passes.

Also removed some "duplicated" RUN lines in a few tests that where
using both -foo and -passes=foo syntax. No need to do the same kind
of testing twice.
2022-10-21 17:02:02 +02:00

23 lines
636 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=reassociate -S < %s | FileCheck %s
declare void @use(i32)
define void @test1(i32 %x, i32 %y) {
; CHECK-LABEL: @test1(
; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[Y:%.*]], [[X:%.*]]
; CHECK-NEXT: [[TMP2:%.*]] = mul i32 [[Y]], [[X]]
; CHECK-NEXT: [[TMP3:%.*]] = sub i32 [[TMP1]], [[TMP2]]
; CHECK-NEXT: call void @use(i32 [[TMP1]])
; CHECK-NEXT: call void @use(i32 [[TMP3]])
; CHECK-NEXT: ret void
;
%1 = mul i32 %x, %y
%2 = mul i32 %y, %x
%3 = sub i32 %1, %2
call void @use(i32 %1)
call void @use(i32 %3)
ret void
}