aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/Transforms/SCCP/arg-type-mismatch.ll
blob: 6361280801bf3ed90128d8fbfa4d40fe07a40a18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature
; RUN: opt < %s -passes=ipsccp -S -o - | FileCheck %s

; This test is just to verify that we do not crash/assert due to mismatch in
; argument type between the caller and callee.

define dso_local void @foo(i16 %a) {
; CHECK-LABEL: define {{[^@]+}}@foo
; CHECK-SAME: (i16 [[A:%.*]]) {
; CHECK-NEXT:    [[CALL:%.*]] = call i16 @bar(i16 [[A]], i32 7)
; CHECK-NEXT:    ret void
;
  %call = call i16 @bar(i16 %a, i32 7)
  ret void
}

define internal i16 @bar(i16 %p1, i16 %p2) {
; CHECK-LABEL: define {{[^@]+}}@bar
; CHECK-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) {
; CHECK-NEXT:    ret i16 [[P2]]
;
  ret i16 %p2
}