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

26 lines
655 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=mem2reg -opaque-pointers < %s | FileCheck %s
define i32 @test_same_type() {
; CHECK-LABEL: @test_same_type(
; CHECK-NEXT: ret i32 0
;
%p = alloca i32
store i32 0, ptr %p
%v = load i32, ptr %p
ret i32 %v
}
define i16 @test_different_type() {
; CHECK-LABEL: @test_different_type(
; CHECK-NEXT: [[P:%.*]] = alloca i32, align 4
; CHECK-NEXT: store i32 0, ptr [[P]], align 4
; CHECK-NEXT: [[V:%.*]] = load i16, ptr [[P]], align 2
; CHECK-NEXT: ret i16 [[V]]
;
%p = alloca i32
store i32 0, ptr %p
%v = load i16, ptr %p
ret i16 %v
}