mirror of
https://github.com/intel/llvm.git
synced 2026-01-25 01:07:04 +08:00
[libc] Make more of the libc unit testing llvm independent
(WIP, hopefully I'll add more to this patch before submitting) Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D91665
This commit is contained in:
@@ -7,19 +7,19 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "StreamWrapper.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace __llvm_libc {
|
||||
namespace testutils {
|
||||
|
||||
StreamWrapper outs() { return {std::addressof(llvm::outs())}; }
|
||||
StreamWrapper outs() { return {std::addressof(std::cout)}; }
|
||||
|
||||
template <typename T> StreamWrapper &StreamWrapper::operator<<(T t) {
|
||||
assert(OS);
|
||||
llvm::raw_ostream &Stream = *reinterpret_cast<llvm::raw_ostream *>(OS);
|
||||
std::ostream &Stream = *reinterpret_cast<std::ostream *>(OS);
|
||||
Stream << t;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user