Skip to content

Commit

Permalink
[Inline] Add test for PR48209 (NFC)
Browse files Browse the repository at this point in the history
The test shows noalias metadata being incorrectly applied to the
instruction producing the argument for the call.
  • Loading branch information
nikic committed Nov 18, 2020
1 parent d1b921e commit b51c290
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions llvm/test/Transforms/Inline/pr48209.ll
@@ -0,0 +1,25 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -inline -S < %s | FileCheck %s

declare void @external_function(i8*)

define internal void @inlined_function(i8* %arg) {
call void @external_function(i8* %arg)
ret void
}

; TODO: This is a miscompile.
define void @test(i8** %p) {
; CHECK-LABEL: @test(
; CHECK-NEXT: [[ARG:%.*]] = load i8*, i8** [[P:%.*]], align 8, !alias.scope !0, !noalias !0
; CHECK-NEXT: call void @external_function(i8* [[ARG]]), !noalias !0
; CHECK-NEXT: ret void
;
%arg = load i8*, i8** %p, !alias.scope !0
tail call void @inlined_function(i8* %arg), !noalias !0
ret void
}

!0 = !{!1}
!1 = distinct !{!1, !2}
!2 = distinct !{!2}

0 comments on commit b51c290

Please sign in to comment.