Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FunctionAttrs] Regenerate test checks (NFC)
- Loading branch information
Showing
6 changed files
with
294 additions
and
90 deletions.
There are no files selected for viewing
27 changes: 17 additions & 10 deletions
27
llvm/test/Transforms/FunctionAttrs/incompatible_fn_attrs.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,39 @@ | ||
; RUN: opt -S -o - -function-attrs %s | FileCheck %s | ||
; RUN: opt -S -o - -passes=function-attrs %s | FileCheck %s | ||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes | ||
; RUN: opt -S -o - -passes=function-attrs < %s | FileCheck %s | ||
|
||
; Verify we remove argmemonly/inaccessiblememonly/inaccessiblemem_or_argmemonly | ||
; function attributes when we derive readnone. | ||
|
||
; Function Attrs: argmemonly | ||
define ptr @given_argmem_infer_readnone(ptr %p) #0 { | ||
; CHECK: define ptr @given_argmem_infer_readnone(ptr readnone returned %p) #0 { | ||
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn | ||
; CHECK-LABEL: @given_argmem_infer_readnone( | ||
; CHECK-NEXT: entry: | ||
; CHECK-NEXT: ret ptr [[P:%.*]] | ||
; | ||
entry: | ||
ret ptr %p | ||
} | ||
|
||
; Function Attrs: inaccessiblememonly | ||
define ptr @given_inaccessible_infer_readnone(ptr %p) #1 { | ||
; CHECK: define ptr @given_inaccessible_infer_readnone(ptr readnone returned %p) #0 { | ||
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn | ||
; CHECK-LABEL: @given_inaccessible_infer_readnone( | ||
; CHECK-NEXT: entry: | ||
; CHECK-NEXT: ret ptr [[P:%.*]] | ||
; | ||
entry: | ||
ret ptr %p | ||
} | ||
|
||
; Function Attrs: inaccessiblemem_or_argmemonly | ||
define ptr @given_inaccessible_or_argmem_infer_readnone(ptr %p) #2 { | ||
; CHECK: define ptr @given_inaccessible_or_argmem_infer_readnone(ptr readnone returned %p) #0 { | ||
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn | ||
; CHECK-LABEL: @given_inaccessible_or_argmem_infer_readnone( | ||
; CHECK-NEXT: entry: | ||
; CHECK-NEXT: ret ptr [[P:%.*]] | ||
; | ||
entry: | ||
ret ptr %p | ||
} | ||
|
||
attributes #0 = { argmemonly } | ||
attributes #1 = { inaccessiblememonly } | ||
attributes #2 = { inaccessiblemem_or_argmemonly } | ||
; CHECK: attributes #0 = { mustprogress nofree norecurse nosync nounwind readnone willreturn } | ||
; CHECK-NOT: attributes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 17 additions & 10 deletions
27
llvm/test/Transforms/FunctionAttrs/operand-bundles-scc.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
; RUN: opt -S -function-attrs < %s | FileCheck %s | ||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes | ||
; RUN: opt -S -passes=function-attrs < %s | FileCheck %s | ||
|
||
define void @f() { | ||
; CHECK-LABEL: define void @f() #0 { | ||
call void @g() [ "unknown"() ] | ||
ret void | ||
; CHECK: Function Attrs: nofree nosync nounwind | ||
; CHECK-LABEL: define {{[^@]+}}@f | ||
; CHECK-SAME: () #[[ATTR0:[0-9]+]] { | ||
; CHECK-NEXT: call void @g() [ "unknown"() ] | ||
; CHECK-NEXT: ret void | ||
; | ||
call void @g() [ "unknown"() ] | ||
ret void | ||
} | ||
|
||
define void @g() { | ||
; CHECK-LABEL: define void @g() #0 { | ||
call void @f() | ||
ret void | ||
; CHECK: Function Attrs: nofree nosync nounwind | ||
; CHECK-LABEL: define {{[^@]+}}@g | ||
; CHECK-SAME: () #[[ATTR0]] { | ||
; CHECK-NEXT: call void @f() | ||
; CHECK-NEXT: ret void | ||
; | ||
call void @f() | ||
ret void | ||
} | ||
|
||
|
||
; CHECK: attributes #0 = { nofree nosync nounwind } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,30 @@ | ||
; RUN: opt -S -function-attrs < %s | FileCheck %s | ||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes | ||
; RUN: opt -S -passes=function-attrs < %s | FileCheck %s | ||
|
||
@i = global i32 0 | ||
|
||
define void @foo() { | ||
; CHECK-LABEL: define void @foo() #0 { | ||
; CHECK: Function Attrs: nofree nosync nounwind | ||
; CHECK-LABEL: define {{[^@]+}}@foo | ||
; CHECK-SAME: () #[[ATTR0:[0-9]+]] { | ||
; CHECK-NEXT: store i32 1, ptr @i, align 4 | ||
; CHECK-NEXT: call void @bar() | ||
; CHECK-NEXT: ret void | ||
; | ||
store i32 1, ptr @i | ||
call void @bar() | ||
ret void | ||
} | ||
|
||
define void @bar() { | ||
; CHECK-LABEL: define void @bar() #0 { | ||
; CHECK: Function Attrs: nofree nosync nounwind | ||
; CHECK-LABEL: define {{[^@]+}}@bar | ||
; CHECK-SAME: () #[[ATTR0]] { | ||
; CHECK-NEXT: [[I:%.*]] = load i32, ptr @i, align 4 | ||
; CHECK-NEXT: call void @foo() | ||
; CHECK-NEXT: ret void | ||
; | ||
%i = load i32, ptr @i | ||
call void @foo() | ||
ret void | ||
} | ||
|
||
; CHECK: attributes #0 = { nofree nosync nounwind } |
Oops, something went wrong.