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 //===----------------------------------------------------------------------===// 8 9 // <locale> 10 11 // class locale::id 12 // { 13 // public: 14 // id(); 15 // void operator=(const id&) = delete; 16 // id(const id&) = delete; 17 // }; 18 19 // This test isn't portable 20 21 #include <locale> 22 #include <cassert> 23 24 #include "test_macros.h" 25 26 std::locale::id id0; 27 std::locale::id id2; 28 std::locale::id id1; 29 main(int,char **)30int main(int, char**) 31 { 32 long id = id0.__get(); 33 assert(id0.__get() == id+0); 34 assert(id0.__get() == id+0); 35 assert(id0.__get() == id+0); 36 assert(id1.__get() == id+1); 37 assert(id1.__get() == id+1); 38 assert(id1.__get() == id+1); 39 assert(id2.__get() == id+2); 40 assert(id2.__get() == id+2); 41 assert(id2.__get() == id+2); 42 assert(id0.__get() == id+0); 43 assert(id0.__get() == id+0); 44 assert(id0.__get() == id+0); 45 assert(id1.__get() == id+1); 46 assert(id1.__get() == id+1); 47 assert(id1.__get() == id+1); 48 assert(id2.__get() == id+2); 49 assert(id2.__get() == id+2); 50 assert(id2.__get() == id+2); 51 52 return 0; 53 } 54