diff options
Diffstat (limited to 'llvm/test/Transforms/FunctionAttrs')
| -rw-r--r-- | llvm/test/Transforms/FunctionAttrs/fn_noreturn.ll | 16 | ||||
| -rw-r--r-- | llvm/test/Transforms/FunctionAttrs/internal-noalias.ll | 2 | ||||
| -rw-r--r-- | llvm/test/Transforms/FunctionAttrs/norecurse.ll | 2 |
3 files changed, 15 insertions, 5 deletions
diff --git a/llvm/test/Transforms/FunctionAttrs/fn_noreturn.ll b/llvm/test/Transforms/FunctionAttrs/fn_noreturn.ll index d0ccb87485b..2b15e0780df 100644 --- a/llvm/test/Transforms/FunctionAttrs/fn_noreturn.ll +++ b/llvm/test/Transforms/FunctionAttrs/fn_noreturn.ll @@ -125,10 +125,12 @@ cond.end: ; preds = %cond.false, %cond.t } -; TEST 6: willreturn means *not* no-return -; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn +; TEST 6a: willreturn means *not* no-return or UB +; FIXME: we should derive "UB" as an argument and report it to the user on request. + +; CHECK: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn ; CHECK-NEXT: define i32 @endless_loop_but_willreturn -define i32 @endless_loop_but_willreturn(i32 %a) willreturn { +define i32 @endless_loop_but_willreturn() willreturn { entry: br label %while.body @@ -136,4 +138,12 @@ while.body: ; preds = %entry, %while.body br label %while.body } +; TEST 6b: willreturn means *not* no-return or UB +; CHECK: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn +; CHECK-NEXT: define i32 @UB_and_willreturn +define i32 @UB_and_willreturn() willreturn { +entry: + unreachable +} + attributes #0 = { noinline nounwind uwtable } diff --git a/llvm/test/Transforms/FunctionAttrs/internal-noalias.ll b/llvm/test/Transforms/FunctionAttrs/internal-noalias.ll index 2ccb4b67e56..9afea1fbf8d 100644 --- a/llvm/test/Transforms/FunctionAttrs/internal-noalias.ll +++ b/llvm/test/Transforms/FunctionAttrs/internal-noalias.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -passes=attributor -aa-pipeline='basic-aa' -attributor-disable=false -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 < %s | FileCheck %s +; RUN: opt -S -passes=attributor -aa-pipeline='basic-aa' -attributor-disable=false -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 < %s | FileCheck %s define dso_local i32 @visible(i32* noalias %A, i32* noalias %B) #0 { entry: diff --git a/llvm/test/Transforms/FunctionAttrs/norecurse.ll b/llvm/test/Transforms/FunctionAttrs/norecurse.ll index 0e67a600f34..132396fc37f 100644 --- a/llvm/test/Transforms/FunctionAttrs/norecurse.ll +++ b/llvm/test/Transforms/FunctionAttrs/norecurse.ll @@ -1,6 +1,6 @@ ; RUN: opt < %s -basicaa -functionattrs -rpo-functionattrs -S | FileCheck %s --check-prefixes=CHECK,BOTH ; RUN: opt < %s -aa-pipeline=basic-aa -passes='cgscc(function-attrs),rpo-functionattrs' -S | FileCheck %s --check-prefixes=CHECK,BOTH -; RUN: opt -passes=attributor --attributor-disable=false -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=4 -S < %s | FileCheck %s --check-prefixes=ATTRIBUTOR,BOTH +; RUN: opt -passes=attributor --attributor-disable=false -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s --check-prefixes=ATTRIBUTOR,BOTH ; CHECK: Function Attrs ; CHECK-SAME: norecurse nounwind readnone |

