brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · b24c0b9 Raw
40 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// Test that WCHAR_MAX as a wchar_t value can be set as the fill character.10 11// UNSUPPORTED: no-wide-characters12 13// Expect the test case to fail on targets where WEOF is the same as14// WCHAR_MAX with the libcpp ABI version 1 implementation. The libcpp ABI15// version 2 implementation fixes the problem.16 17// XFAIL: target={{.*}}-windows{{.*}} && libcpp-abi-version=118// XFAIL: target=armv{{7|8}}{{l?}}{{.*}}-linux-gnueabihf && libcpp-abi-version=119// XFAIL: target=aarch64{{.*}}-linux-gnu && libcpp-abi-version=120// XFAIL: target=aarch64{{.*}}-amazon-linux && libcpp-abi-version=121 22#include <iomanip>23#include <ostream>24#include <cassert>25#include <string>26 27template <class CharT>28struct testbuf : public std::basic_streambuf<CharT> {29  testbuf() {}30};31 32int main(int, char**) {33  testbuf<wchar_t> sb;34  std::wostream os(&sb);35  os << std::setfill((wchar_t)WCHAR_MAX);36  assert(os.fill() == (wchar_t)WCHAR_MAX);37 38  return 0;39}40