mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 11:35:51 -04:00

There are scenarios where mutually recursive functions may cause the SCC to contain both read only and write only functions. This removes an assertion when adding read attributes which caused a crash with a the provided test case, and instead just doesn't add the attributes. Patch by Luke Lau <luke.lau@intel.com> Differential Revision: https://reviews.llvm.org/D60761 llvm-svn: 366090
21 lines
405 B
LLVM
21 lines
405 B
LLVM
; RUN: opt -S -functionattrs < %s | FileCheck %s
|
|
; RUN: opt -S -passes=function-attrs < %s | FileCheck %s
|
|
|
|
@i = global i32 0
|
|
|
|
define void @foo() {
|
|
; CHECK-LABEL: define void @foo() #0 {
|
|
store i32 1, i32* @i
|
|
call void @bar()
|
|
ret void
|
|
}
|
|
|
|
define void @bar() {
|
|
; CHECK-LABEL: define void @bar() #0 {
|
|
%i = load i32, i32* @i
|
|
call void @foo()
|
|
ret void
|
|
}
|
|
|
|
; CHECK: attributes #0 = { nofree nounwind }
|