[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / support / DefaultOnly.h
blob2e9e7029c5e3625eca8c25ff4d0800df0bdbd165
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef DEFAULTONLY_H
10 #define DEFAULTONLY_H
12 #include <cassert>
14 class DefaultOnly
16 int data_;
18 DefaultOnly(const DefaultOnly&);
19 DefaultOnly& operator=(const DefaultOnly&);
20 public:
21 static int count;
23 DefaultOnly() : data_(-1) {++count;}
24 ~DefaultOnly() {data_ = 0; --count;}
26 friend bool operator==(const DefaultOnly& x, const DefaultOnly& y)
27 {return x.data_ == y.data_;}
28 friend bool operator< (const DefaultOnly& x, const DefaultOnly& y)
29 {return x.data_ < y.data_;}
32 int DefaultOnly::count = 0;
34 #endif // DEFAULTONLY_H