diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-11-07 01:56:00 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-11-07 01:56:00 +0000 |
commit | e70403f1977ee7c22814d8a45aff0bb39f95a194 (patch) | |
tree | f5693ae08e1bd34bd71dc3ee3bab5c8fc5bececb /test/Feature | |
parent | d044355f2d319b2003186187aabe2d0ed6e63684 (diff) |
[FunctionAttrs] Add handling for operand bundles
Summary:
Teach the FunctionAttrs to do the right thing for IR with operand
bundles.
Reviewers: reames, chandlerc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D14408
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252387 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Feature')
-rw-r--r-- | test/Feature/OperandBundles/function-attrs.ll | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/Feature/OperandBundles/function-attrs.ll b/test/Feature/OperandBundles/function-attrs.ll new file mode 100644 index 00000000000..3d429b3e9d9 --- /dev/null +++ b/test/Feature/OperandBundles/function-attrs.ll @@ -0,0 +1,24 @@ +; RUN: opt -S -functionattrs < %s | FileCheck %s + +declare void @f_readonly() readonly +declare void @f_readnone() readnone + +define void @test_0(i32* %x) { +; FunctionAttrs must not infer readonly / readnone for %x + +; CHECK-LABEL: define void @test_0(i32* %x) { + entry: + ; CHECK: call void @f_readonly() [ "foo"(i32* %x) ] + call void @f_readonly() [ "foo"(i32* %x) ] + ret void +} + +define void @test_1(i32* %x) { +; FunctionAttrs must not infer readonly / readnone for %x + +; CHECK-LABEL: define void @test_1(i32* %x) { + entry: + ; CHECK: call void @f_readnone() [ "foo"(i32* %x) ] + call void @f_readnone() [ "foo"(i32* %x) ] + ret void +} |