diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2013-08-02 22:29:40 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2013-08-02 22:29:40 +0000 |
commit | bd6c7459bb1be4b492be95a3b19ab2dccaa7f53a (patch) | |
tree | 40e5bb226cc050b40261dbb5667ba50f95abf5b9 /llvm/unittests/IR/AttributesTest.cpp | |
parent | f6e90afbf4bfee9894fed71656969bdee410b1d4 (diff) | |
download | llvm-bd6c7459bb1be4b492be95a3b19ab2dccaa7f53a.zip llvm-bd6c7459bb1be4b492be95a3b19ab2dccaa7f53a.tar.gz llvm-bd6c7459bb1be4b492be95a3b19ab2dccaa7f53a.tar.bz2 |
Make one of the AttributeSet ctors maintain the invariant that the
attribute list is ordered by index.
Differential Revision: http://llvm-reviews.chandlerc.com/D1265
llvm-svn: 187682
Diffstat (limited to 'llvm/unittests/IR/AttributesTest.cpp')
-rw-r--r-- | llvm/unittests/IR/AttributesTest.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/unittests/IR/AttributesTest.cpp b/llvm/unittests/IR/AttributesTest.cpp index 2368bdf..ebcb772 100644 --- a/llvm/unittests/IR/AttributesTest.cpp +++ b/llvm/unittests/IR/AttributesTest.cpp @@ -31,4 +31,17 @@ TEST(Attributes, Uniquing) { EXPECT_EQ(SetA, SetB); } +TEST(Attributes, Ordering) { + LLVMContext C; + + AttributeSet ASs[] = { + AttributeSet::get(C, 2, Attribute::ZExt), + AttributeSet::get(C, 1, Attribute::SExt) + }; + + AttributeSet SetA = AttributeSet::get(C, ASs); + AttributeSet SetB = SetA.removeAttributes(C, 1, ASs[1]); + EXPECT_NE(SetA, SetB); +} + } // end anonymous namespace |