1 //===-- Unittests for puts ---------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 #include "src/stdio/puts.h"
11 #include "test/UnitTest/Test.h"
13 TEST(LlvmLibcPutsTest
, PrintOut
) {
16 constexpr char simple
[] = "A simple string";
17 result
= __llvm_libc::puts(simple
);
20 // check that it appends a second newline at the end.
21 constexpr char numbers
[] = "1234567890\n";
22 result
= __llvm_libc::puts(numbers
);
25 constexpr char more
[] = "1234 and more\n6789 and rhyme";
26 result
= __llvm_libc::puts(more
);