[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / libc / test / src / stdio / puts_test.cpp
bloba9fe1717783fd34607c6d27000e52b798fed67fe
1 //===-- Unittests for puts ---------------------------------------------===//
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 #include "src/stdio/puts.h"
11 #include "test/UnitTest/Test.h"
13 TEST(LlvmLibcPutsTest, PrintOut) {
14 int result;
16 constexpr char simple[] = "A simple string";
17 result = __llvm_libc::puts(simple);
18 EXPECT_GE(result, 0);
20 // check that it appends a second newline at the end.
21 constexpr char numbers[] = "1234567890\n";
22 result = __llvm_libc::puts(numbers);
23 EXPECT_GE(result, 0);
25 constexpr char more[] = "1234 and more\n6789 and rhyme";
26 result = __llvm_libc::puts(more);
27 EXPECT_GE(result, 0);