brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · a797abb Raw
52 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// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2010// UNSUPPORTED: no-filesystem11// UNSUPPORTED: executor-has-no-bash12// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME13 14// FIXME PRINT How to test println on Windows?15// XFAIL: msvc, target={{.+}}-windows-gnu16 17// XFAIL: availability-fp_to_chars-missing18 19// <print>20 21//   void println();22 23// Testing this properly is quite hard; the function unconditionally24// writes to stdout. When stdout is redirected to a file it is no longer25// considered a terminal. The function is a small wrapper around26//27// template<class... Args>28//   void println(FILE* stream, format_string<Args...> fmt, Args&&... args);29//30// So do minimal tests for this function and rely on the FILE* overload31// to do more testing.32//33// The testing is based on the testing for std::cout.34 35// TODO PRINT Use lit builtin echo36 37// FILE_DEPENDENCIES: echo.sh38// RUN: %{build}39// RUN: %{exec} bash echo.sh -ne "println blank line test: \n" > %t.expected40// RUN: %{exec} "%t.exe" > %t.actual41// RUN: diff -u %t.actual %t.expected42 43#include <print>44 45int main(int, char**) {46  // On some configurations the `diff -u` test fails if we print a single blank line character `\n`, so we print some text first.47  std::print("println blank line test: ");48  std::println();49 50  return 0;51}52