|
reference, declaration → definition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
|
References
include/llvm/Support/FormatVariadic.h 145 operator std::string() const { return str(); }
include/llvm/Support/JSON.h 317 Value(const llvm::formatv_object_base &V) : Value(V.str()) {}
508 ObjectKey(const llvm::formatv_object_base &V) : ObjectKey(V.str()) {}
lib/DebugInfo/CodeView/TypeDumpVisitor.cpp 355 W->printString("Guid", formatv("{0}", TS.getGuid()).str());
lib/IR/PassTimingInfo.cpp 124 num <= 1 ? PassDesc.str() : formatv("{0} #{1}", PassDesc, num).str();
175 std::string FullDesc = formatv("{0} #{1}", PassID, Count).str();
lib/Passes/PassBuilder.cpp 1471 formatv("invalid LoopUnrollPass parameter '{0}' ", ParamName).str(),
1490 formatv("invalid LoopUnrollPass parameter '{0}' ", ParamName).str(),
1513 .str(),
1518 .str(),
1547 ParamName).str(),
1552 formatv("invalid SimplifyCFG pass parameter '{0}' ", ParamName).str(),
1573 formatv("invalid LoopVectorize parameter '{0}' ", ParamName).str(),
1592 .str(),
1612 .str(),
1854 formatv("invalid use of '{0}' pass as module pipeline", Name).str(),
1864 formatv("unknown default pipeline alias '{0}'", Name).str(),
1929 formatv("unknown module pass '{0}'", Name).str(),
1983 formatv("invalid use of '{0}' pass as cgscc pipeline", Name).str(),
2012 formatv("unknown cgscc pass '{0}'", Name).str(),
2059 formatv("invalid use of '{0}' pass as function pipeline", Name).str(),
2095 formatv("unknown function pass '{0}'", Name).str(),
2130 formatv("invalid use of '{0}' pass as loop pipeline", Name).str(),
2166 return make_error<StringError>(formatv("unknown loop pass '{0}'", Name).str(),
2264 formatv("invalid pipeline '{0}'", PipelineText).str(),
2289 .str(),
2307 formatv("invalid pipeline '{0}'", PipelineText).str(),
2315 .str(),
2332 formatv("invalid pipeline '{0}'", PipelineText).str(),
2340 .str(),
2356 formatv("invalid pipeline '{0}'", PipelineText).str(),
2379 formatv("unknown alias analysis name '{0}'", Name).str(),
lib/Passes/StandardInstrumentations.cpp 43 return std::make_pair(M, formatv(" (function: {0})", F->getName()).str());
52 return std::make_pair(M, formatv(" (scc: {0})", C->getName()).str());
67 return std::make_pair(M, formatv(" (loop: {0})", ss.str()).str());
lib/Support/FileCheck.cpp 1314 .str();
1316 Message += formatv(" ({0} out of {1})", MatchedCount, Pat.getCount()).str();
1377 .str();
1379 Message += formatv(" ({0} out of {1})", MatchedCount, Pat.getCount()).str();
lib/Support/Signals.cpp 185 OS << right_justify(formatv("#{0}", frame_no++).str(),
lib/Support/Twine.cpp 25 return LHS.formatvObject->str();
lib/Transforms/Utils/MisExpect.cpp 87 ORE.emit(OptimizationRemark(DEBUG_TYPE, "misexpect", Cond) << RemStr.str());
tools/clang/lib/Driver/Driver.cpp 1529 std::string Usage = llvm::formatv("{0} [options] file...", Name).str();
tools/clang/tools/extra/clangd/ClangdLSPServer.cpp 727 llvm::formatv("Unsupported command \"{0}\".", Params.command).str(),
tools/clang/tools/extra/clangd/IncludeFixer.cpp 405 auto ReqStr = llvm::formatv("{0}", toJSON(Req)).str();
tools/clang/tools/extra/clangd/unittests/DiagnosticsTests.cpp 72 .str();
tools/clang/tools/libclang/CIndexCodeCompletion.cpp 755 .str();
tools/lldb/include/lldb/Interpreter/CommandReturnObject.h 114 AppendMessage(llvm::formatv(format, std::forward<Args>(args)...).str());
124 AppendError(llvm::formatv(format, std::forward<Args>(args)...).str());
tools/lldb/include/lldb/Utility/Status.h 176 SetErrorString(llvm::formatv(format, std::forward<Args>(args)...).str());
tools/lldb/include/lldb/Utility/Stream.h 423 PutCString(llvm::formatv(format, std::forward<Args>(args)...).str());
tools/lldb/source/Interpreter/Options.cpp 933 std::string short_opt = llvm::formatv("-{0}", char(long_option.val)).str();
1028 llvm::formatv("Invalid option with value '{0}'.", char(val)).str(),
1045 .str(),
1059 .str(),
tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxBitset.cpp 109 m_elements[idx] = CreateValueObjectFromData(llvm::formatv("[{0}]", idx).str(),
tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp 288 return CreateValueObjectFromData(llvm::formatv("[{0}]", idx).str(), data,
tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxOptional.cpp 74 return val_sp->Clone(ConstString(llvm::formatv("Value").str()));
tools/lldb/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp 80 elem_sp->Clone(ConstString(llvm::formatv("[{0}]", idx).str())).get();
tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp 1152 version_patch).str());
1699 return llvm::formatv("{0}[{1}]", SegmentName, SegmentCount).str();
tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp 1107 llvm::formatv("--log-file={0}", env_debugserver_log_file).str());
1123 .str());
tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 3975 std::string packet = formatv("QPassSignals:{0:$[;]@(x-2)}", range).str();
tools/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp 67 s.value(llvm::formatv("Python Obj: {0:X}", GetValue()).str());
tools/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp 328 llvm::formatv("<unnamed-type-$S{0}>", unnamed_type_index).str();
tools/lldb/tools/lldb-test/lldb-test.cpp 281 llvm::formatv(Format, std::forward<Args>(args)...).str(),
tools/lldb/tools/lldb-vscode/lldb-vscode.cpp 1227 llvm::formatv("Could not load program '{0}'.", program).str());
tools/lldb/unittests/Host/HostTest.cpp 16 EXPECT_EQ("W01", formatv("{0:g}", WaitStatus{WaitStatus::Exit, 1}).str());
17 EXPECT_EQ("X02", formatv("{0:g}", WaitStatus{WaitStatus::Signal, 2}).str());
18 EXPECT_EQ("S03", formatv("{0:g}", WaitStatus{WaitStatus::Stop, 3}).str());
20 formatv("{0}", WaitStatus{WaitStatus::Exit, 4}).str());
tools/lldb/unittests/Host/MainLoopTest.cpp 46 .str());
tools/lldb/unittests/Target/MemoryRegionInfoTest.cpp 16 EXPECT_EQ("yes", llvm::formatv("{0}", MemoryRegionInfo::eYes).str());
17 EXPECT_EQ("no", llvm::formatv("{0}", MemoryRegionInfo::eNo).str());
18 EXPECT_EQ("don't know", llvm::formatv("{0}", MemoryRegionInfo::eDontKnow).str());
tools/lldb/unittests/Utility/ConstStringTest.cpp 16 EXPECT_EQ("foo", llvm::formatv("{0}", ConstString("foo")).str());
tools/lldb/unittests/Utility/FileSpecTest.cpp 275 EXPECT_EQ("(empty)", llvm::formatv("{0}", F).str());
276 EXPECT_EQ("(empty)", llvm::formatv("{0:D}", F).str());
277 EXPECT_EQ("(empty)", llvm::formatv("{0:F}", F).str());
280 EXPECT_EQ("C:\\foo\\bar.txt", llvm::formatv("{0}", F).str());
281 EXPECT_EQ("C:\\foo\\", llvm::formatv("{0:D}", F).str());
282 EXPECT_EQ("bar.txt", llvm::formatv("{0:F}", F).str());
285 EXPECT_EQ("foo\\bar.txt", llvm::formatv("{0}", F).str());
286 EXPECT_EQ("foo\\", llvm::formatv("{0:D}", F).str());
287 EXPECT_EQ("bar.txt", llvm::formatv("{0:F}", F).str());
290 EXPECT_EQ("foo", llvm::formatv("{0}", F).str());
291 EXPECT_EQ("foo", llvm::formatv("{0:F}", F).str());
292 EXPECT_EQ("(empty)", llvm::formatv("{0:D}", F).str());
tools/lldb/unittests/Utility/LogTest.cpp 243 .str(),
tools/lldb/unittests/Utility/StateTest.cpp 17 EXPECT_EQ("invalid", llvm::formatv("{0}", eStateInvalid).str());
18 EXPECT_EQ("unloaded", llvm::formatv("{0}", eStateUnloaded).str());
19 EXPECT_EQ("connected", llvm::formatv("{0}", eStateConnected).str());
20 EXPECT_EQ("attaching", llvm::formatv("{0}", eStateAttaching).str());
21 EXPECT_EQ("launching", llvm::formatv("{0}", eStateLaunching).str());
22 EXPECT_EQ("stopped", llvm::formatv("{0}", eStateStopped).str());
23 EXPECT_EQ("running", llvm::formatv("{0}", eStateRunning).str());
24 EXPECT_EQ("stepping", llvm::formatv("{0}", eStateStepping).str());
25 EXPECT_EQ("crashed", llvm::formatv("{0}", eStateCrashed).str());
26 EXPECT_EQ("detached", llvm::formatv("{0}", eStateDetached).str());
27 EXPECT_EQ("exited", llvm::formatv("{0}", eStateExited).str());
28 EXPECT_EQ("suspended", llvm::formatv("{0}", eStateSuspended).str());
tools/lldb/unittests/Utility/StatusTest.cpp 20 EXPECT_EQ("", llvm::formatv("{0}", Status()).str());
21 EXPECT_EQ("Hello Status", llvm::formatv("{0}", Status("Hello Status")).str());
22 EXPECT_EQ("Hello", llvm::formatv("{0:5}", Status("Hello Error")).str());
tools/lldb/unittests/Utility/TimeoutTest.cpp 26 llvm::formatv("{0}", Timeout<std::milli>(llvm::None)).str());
28 llvm::formatv("{0}", Timeout<std::milli>(seconds(1))).str());
tools/lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp 373 .str();
tools/lldb/unittests/tools/lldb-server/tests/MessageObjects.h 175 llvm::formatv(format.data(), std::forward<Args>(args)...).str();
tools/lldb/unittests/tools/lldb-server/tests/TestClient.cpp 156 return SendMessage(formatv("Z0,{0:x-},1", address).str());
162 return Continue(formatv("vCont;c:{0:x-}", thread_id).str());
201 formatv("Error sending message `{0}`: {1}", message, result).str(),
223 std::string Message = formatv("qRegisterInfo{0:x-}", Reg).str();
264 .str(),
tools/llvm-exegesis/lib/X86/Target.cpp 232 .str();
tools/llvm-pdbutil/BytesOutputStyle.cpp 221 std::string Label = formatv("Block {0}", I).str();
318 P.formatMsfStreamData(formatv("Type {0}", TI).str(), File, Layout, OneType);
tools/llvm-pdbutil/DumpOutputStyle.cpp 552 NameInsert = formatv("[{0}]", SectionName).str();
tools/llvm-pdbutil/FormatUtil.cpp 55 return formatv("{0} \"{1}\"", Label, Name).str();
59 return formatv("{0} \"{1}\"", Label, TN).str();
66 return formatv("{0} \"{1}\"", Label, Name).str();
70 return formatv("{0} \"{1}\"", Label, TN).str();
tools/llvm-pdbutil/FormatUtil.h 47 .str();
tools/llvm-pdbutil/MinimalSymbolDumper.cpp 329 .str();
336 GapStrs.push_back(formatv("({0},{1})", G.GapStartOffset, G.Range).str());
369 return formatv("{0}", TI).str();
tools/llvm-pdbutil/MinimalTypeDumper.cpp 50 formatv("forward ref ({0} {1})", Direction, *ETI).str();
388 .str();
tools/llvm-pdbutil/StreamUtil.cpp 26 return formatv("Named Stream \"{0}\"", Name).str();
28 return formatv("Module \"{0}\"", Name).str();
tools/llvm-readobj/ObjDumper.cpp 71 createError(formatv("could not find section '{0}'", S.first).str()),
77 createError(formatv("could not find section {0}", S.first).str()),
unittests/ADT/APFloatTest.cpp 3415 .str();
3425 .str();
3479 .str();
3483 .str();
3493 .str();
3497 .str();
3528 .str();
3532 .str();
3583 .str();
3593 .str();
3656 .str();
3660 .str();
3670 .str();
3674 .str();
3703 .str();
3707 .str();
3736 .str();
3740 .str();
3771 .str();
3775 .str();
3842 .str();
3874 .str();
unittests/Analysis/ProfileSummaryInfoTest.cpp 91 formatv(ModuleString, formatv(SummaryString, ProfKind).str()).str(),
91 formatv(ModuleString, formatv(SummaryString, ProfKind).str()).str(),
94 return parseAssemblyString(formatv(ModuleString, "").str(), Err, C);
unittests/BinaryFormat/DwarfTest.cpp 196 EXPECT_EQ("DW_AT_name", formatv("{0}", DW_AT_name).str());
197 EXPECT_EQ("DW_AT_unknown_3fff", formatv("{0}", DW_AT_hi_user).str());
198 EXPECT_EQ("DW_FORM_addr", formatv("{0}", DW_FORM_addr).str());
199 EXPECT_EQ("DW_FORM_unknown_1f00", formatv("{0}", DW_FORM_lo_user).str());
200 EXPECT_EQ("DW_IDX_compile_unit", formatv("{0}", DW_IDX_compile_unit).str());
201 EXPECT_EQ("DW_IDX_unknown_3fff", formatv("{0}", DW_IDX_hi_user).str());
202 EXPECT_EQ("DW_TAG_compile_unit", formatv("{0}", DW_TAG_compile_unit).str());
203 EXPECT_EQ("DW_TAG_unknown_ffff", formatv("{0}", DW_TAG_hi_user).str());
unittests/Support/Chrono.cpp 53 EXPECT_EQ("2006-01-02 15:04:05.123456789", formatv("{0}", T).str());
55 EXPECT_EQ("15:04:05", formatv("{0:%H:%M:%S}", T).str());
57 EXPECT_EQ("123", formatv("{0:%L}", T).str());
58 EXPECT_EQ("123456", formatv("{0:%f}", T).str());
59 EXPECT_EQ("123456789", formatv("{0:%N}", T).str());
61 EXPECT_EQ("%foo", formatv("{0:%%foo}", T).str());
82 EXPECT_EQ("1 h", formatv("{0}", hours(1)).str());
83 EXPECT_EQ("1 m", formatv("{0}", minutes(1)).str());
84 EXPECT_EQ("1 s", formatv("{0}", seconds(1)).str());
85 EXPECT_EQ("1 ms", formatv("{0}", milliseconds(1)).str());
86 EXPECT_EQ("1 us", formatv("{0}", microseconds(1)).str());
87 EXPECT_EQ("1 ns", formatv("{0}", nanoseconds(1)).str());
89 EXPECT_EQ("1 s", formatv("{0:+}", seconds(1)).str());
90 EXPECT_EQ("1", formatv("{0:-}", seconds(1)).str());
92 EXPECT_EQ("1000 ms", formatv("{0:ms}", seconds(1)).str());
93 EXPECT_EQ("1000000 us", formatv("{0:us}", seconds(1)).str());
94 EXPECT_EQ("1000", formatv("{0:ms-}", seconds(1)).str());
96 EXPECT_EQ("1,000 ms", formatv("{0:+n}", milliseconds(1000)).str());
97 EXPECT_EQ("0x3e8", formatv("{0:-x}", milliseconds(1000)).str());
98 EXPECT_EQ("010", formatv("{0:-3}", milliseconds(10)).str());
99 EXPECT_EQ("10,000", formatv("{0:ms-n}", seconds(10)).str());
101 EXPECT_EQ("1.00 s", formatv("{0}", duration<float>(1)).str());
102 EXPECT_EQ("0.123 s", formatv("{0:+3}", duration<float>(0.123f)).str());
103 EXPECT_EQ("1.230e-01 s", formatv("{0:+e3}", duration<float>(0.123f)).str());
107 EXPECT_EQ("1.00", formatv("{0:-}", microfortnights(1)).str());
108 EXPECT_EQ("1209.60 ms", formatv("{0:ms}", microfortnights(1)).str());
unittests/Support/FormatVariadicTest.cpp 263 EXPECT_EQ("", formatv("").str());
264 EXPECT_EQ("Test", formatv("Test").str());
268 EXPECT_EQ("1", formatv("{0}", 1).str());
269 EXPECT_EQ("c", formatv("{0}", 'c').str());
270 EXPECT_EQ("-3", formatv("{0}", -3).str());
271 EXPECT_EQ("Test", formatv("{0}", "Test").str());
272 EXPECT_EQ("Test2", formatv("{0}", StringRef("Test2")).str());
273 EXPECT_EQ("Test3", formatv("{0}", std::string("Test3")).str());
278 EXPECT_EQ("0", formatv("{0}", 0).str());
279 EXPECT_EQ("2748", formatv("{0}", 0xABC).str());
280 EXPECT_EQ("-2748", formatv("{0}", -0xABC).str());
283 EXPECT_EQ("0xFF", formatv("{0:X}", 255).str());
284 EXPECT_EQ("0xFF", formatv("{0:X+}", 255).str());
285 EXPECT_EQ("0xff", formatv("{0:x}", 255).str());
286 EXPECT_EQ("0xff", formatv("{0:x+}", 255).str());
287 EXPECT_EQ("FF", formatv("{0:X-}", 255).str());
288 EXPECT_EQ("ff", formatv("{0:x-}", 255).str());
292 EXPECT_EQ("0xFF", formatv("{0:X2}", 255).str());
293 EXPECT_EQ("0xFF", formatv("{0:X+2}", 255).str());
294 EXPECT_EQ("0x0ff", formatv("{0:x3}", 255).str());
295 EXPECT_EQ("0x0ff", formatv("{0:x+3}", 255).str());
296 EXPECT_EQ("00FF", formatv("{0:X-4}", 255).str());
297 EXPECT_EQ("00ff", formatv("{0:x-4}", 255).str());
301 formatv("{0:X16}", -2401053088876216593LL).str());
303 formatv("{0:X16}", 0xFEEBDAEDFEEBDAEDULL).str());
304 EXPECT_EQ("0x00000000DEADBEEF", formatv("{0:X16}", 0xDEADBEEF).str());
307 EXPECT_EQ("0xff", formatv("{0,4:x}", 255).str());
308 EXPECT_EQ(" 0xff", formatv("{0,5:x+}", 255).str());
309 EXPECT_EQ(" FF", formatv("{0,4:X-}", 255).str());
310 EXPECT_EQ(" ff", formatv("{0,5:x-}", 255).str());
313 EXPECT_EQ(" 0x0ff", formatv("{0,7:x3}", 255).str());
314 EXPECT_EQ(" 0x00ff", formatv("{0,7:x+4}", 255).str());
315 EXPECT_EQ(" 000FF", formatv("{0,7:X-5}", 255).str());
316 EXPECT_EQ(" 0000ff", formatv("{0,7:x-6}", 255).str());
319 EXPECT_EQ(" 255", formatv("{0,7:3}", 255).str());
320 EXPECT_EQ(" 0255", formatv("{0,7:4}", 255).str());
321 EXPECT_EQ(" 00255", formatv("{0,7:5}", 255).str());
322 EXPECT_EQ(" 000255", formatv("{0,7:6}", 255).str());
328 EXPECT_EQ("0x00000000", formatv("{0}", (void *)0).str());
329 EXPECT_EQ("0x00000ABC", formatv("{0}", (void *)0xABC).str());
331 EXPECT_EQ("0x0000000000000000", formatv("{0}", (void *)0).str());
332 EXPECT_EQ("0x0000000000000ABC", formatv("{0}", (void *)0xABC).str());
336 EXPECT_EQ("0x0", formatv("{0:0}", (void *)0).str());
337 EXPECT_EQ("0xABC", formatv("{0:0}", (void *)0xABC).str());
338 EXPECT_EQ("0x0000", formatv("{0:4}", (void *)0).str());
339 EXPECT_EQ("0x0ABC", formatv("{0:4}", (void *)0xABC).str());
342 EXPECT_EQ("0x0ABC", formatv("{0:X4}", (void *)0xABC).str());
343 EXPECT_EQ("0x0abc", formatv("{0:x4}", (void *)0xABC).str());
344 EXPECT_EQ("0ABC", formatv("{0:X-4}", (void *)0xABC).str());
345 EXPECT_EQ("0abc", formatv("{0:x-4}", (void *)0xABC).str());
350 EXPECT_EQ("0", formatv("{0:N}", 0).str());
351 EXPECT_EQ("10", formatv("{0:N}", 10).str());
352 EXPECT_EQ("100", formatv("{0:N}", 100).str());
353 EXPECT_EQ("1,000", formatv("{0:N}", 1000).str());
354 EXPECT_EQ("1,234,567,890", formatv("{0:N}", 1234567890).str());
355 EXPECT_EQ("-10", formatv("{0:N}", -10).str());
356 EXPECT_EQ("-100", formatv("{0:N}", -100).str());
357 EXPECT_EQ("-1,000", formatv("{0:N}", -1000).str());
358 EXPECT_EQ("-1,234,567,890", formatv("{0:N}", -1234567890).str());
362 EXPECT_EQ(" 1", formatv("{0,2:N}", 1).str());
366 EXPECT_EQ(" 1,000", formatv("{0,6:N}", 1000).str());
367 EXPECT_EQ(" -1,000", formatv("{0,7:N}", -1000).str());
370 EXPECT_EQ(" 1,000", formatv("{0,11:N}", 1000).str());
371 EXPECT_EQ(" -1,000", formatv("{0,11:N}", -1000).str());
372 EXPECT_EQ(" -100,000", formatv("{0,11:N}", -100000).str());
382 EXPECT_EQ(FooArray, formatv("{0}", FooArray).str());
383 EXPECT_EQ(FooPtr, formatv("{0}", FooPtr).str());
384 EXPECT_EQ(FooRef, formatv("{0}", FooRef).str());
385 EXPECT_EQ(FooLiteral, formatv("{0}", FooLiteral).str());
386 EXPECT_EQ(FooString, formatv("{0}", FooString).str());
390 EXPECT_EQ("FooA", formatv("{0:4}", FooArray).str());
391 EXPECT_EQ("FooP", formatv("{0:4}", FooPtr).str());
392 EXPECT_EQ("FooR", formatv("{0:4}", FooRef).str());
393 EXPECT_EQ("FooS", formatv("{0:4}", FooString).str());
396 EXPECT_EQ(" FooA", formatv("{0,6:4}", FooArray).str());
397 EXPECT_EQ(" FooP", formatv("{0,6:4}", FooPtr).str());
398 EXPECT_EQ(" FooR", formatv("{0,6:4}", FooRef).str());
399 EXPECT_EQ(" FooS", formatv("{0,6:4}", FooString).str());
404 EXPECT_EQ("C", formatv("{0}", 'C').str());
405 EXPECT_EQ(" C", formatv("{0,3}", 'C').str());
410 EXPECT_EQ("37", formatv("{0:D}", (char)37).str());
411 EXPECT_EQ(" 037", formatv("{0,5:D3}", (char)37).str());
416 EXPECT_EQ("true", formatv("{0}", true).str());
417 EXPECT_EQ("false", formatv("{0}", false).str());
418 EXPECT_EQ("true", formatv("{0:t}", true).str());
419 EXPECT_EQ("false", formatv("{0:t}", false).str());
422 EXPECT_EQ("TRUE", formatv("{0:T}", true).str());
423 EXPECT_EQ("FALSE", formatv("{0:T}", false).str());
426 EXPECT_EQ("1", formatv("{0:D}", true).str());
427 EXPECT_EQ("0", formatv("{0:D}", false).str());
428 EXPECT_EQ("1", formatv("{0:d}", true).str());
429 EXPECT_EQ("0", formatv("{0:d}", false).str());
432 EXPECT_EQ("YES", formatv("{0:Y}", true).str());
433 EXPECT_EQ("NO", formatv("{0:Y}", false).str());
436 EXPECT_EQ("yes", formatv("{0:y}", true).str());
437 EXPECT_EQ("no", formatv("{0:y}", false).str());
444 EXPECT_EQ("0.000000E+00", formatv("{0:E}", 0.0).str());
445 EXPECT_EQ("-0.000000E+00", formatv("{0:E}", -0.0).str());
446 EXPECT_EQ("1.100000E+00", formatv("{0:E}", 1.1).str());
447 EXPECT_EQ("-1.100000E+00", formatv("{0:E}", -1.1).str());
448 EXPECT_EQ("1.234568E+03", formatv("{0:E}", 1234.5678).str());
449 EXPECT_EQ("-1.234568E+03", formatv("{0:E}", -1234.5678).str());
450 EXPECT_EQ("1.234568E-03", formatv("{0:E}", .0012345678).str());
451 EXPECT_EQ("-1.234568E-03", formatv("{0:E}", -.0012345678).str());
454 EXPECT_EQ(" 0.000E+00", formatv("{0,11:E3}", 0.0).str());
455 EXPECT_EQ(" -1.100E+00", formatv("{0,11:E3}", -1.1).str());
456 EXPECT_EQ(" 1.235E+03", formatv("{0,11:E3}", 1234.5678).str());
457 EXPECT_EQ(" -1.235E-03", formatv("{0,11:E3}", -.0012345678).str());
460 EXPECT_EQ("0.00", formatv("{0:F}", 0.0).str());
461 EXPECT_EQ("-0.00", formatv("{0:F}", -0.0).str());
462 EXPECT_EQ("1.10", formatv("{0:F}", 1.1).str());
463 EXPECT_EQ("-1.10", formatv("{0:F}", -1.1).str());
464 EXPECT_EQ("1234.57", formatv("{0:F}", 1234.5678).str());
465 EXPECT_EQ("-1234.57", formatv("{0:F}", -1234.5678).str());
466 EXPECT_EQ("0.00", formatv("{0:F}", .0012345678).str());
467 EXPECT_EQ("-0.00", formatv("{0:F}", -.0012345678).str());
470 EXPECT_EQ(" 0.000", formatv("{0,8:F3}", 0.0).str());
471 EXPECT_EQ(" -1.100", formatv("{0,8:F3}", -1.1).str());
472 EXPECT_EQ("1234.568", formatv("{0,8:F3}", 1234.5678).str());
473 EXPECT_EQ(" -0.001", formatv("{0,8:F3}", -.0012345678).str());
478 EXPECT_EQ("==123", formatv("{0,=+5}", 123).str());
479 EXPECT_EQ("=123=", formatv("{0,==5}", 123).str());
480 EXPECT_EQ("123==", formatv("{0,=-5}", 123).str());
483 EXPECT_EQ("=00123=", formatv("{0,==7:5}", 123).str());
547 formatv("{0}", make_range(IntRange.begin(), IntRange.end())).str());
550 .str());
555 formatv("{0:$[/]}", make_range(IntRange.begin(), IntRange.end())).str());
560 formatv("{0:@[x]}", make_range(IntRange.begin(), IntRange.end())).str());
566 .str());
573 .str());
577 .str());
581 .str());
586 .str());
591 .str());
601 EXPECT_EQ("-7", formatv("{0}", Negative(7)).str());
606 formatv("{0}", fmt_align(N, AlignStyle::Center, 7)).str());
608 formatv("{0}", fmt_align(N, AlignStyle::Center, 7, '-')).str());
609 EXPECT_EQ(" 171 ", formatv("{0}", fmt_pad(N, 1, 3)).str());
610 EXPECT_EQ("171171171171171", formatv("{0}", fmt_repeat(N, 5)).str());
613 formatv("{0:X-}", fmt_pad(fmt_repeat(N, 5), 1, 3)).str());
615 formatv("{0,=34:X-}", fmt_repeat(fmt_pad(N, 1, 3), 5)).str());
633 EXPECT_EQ("Format", formatv("{0}", Format(1)).str());
636 EXPECT_EQ("Format", formatv("{0}", var).str());
637 EXPECT_EQ("Format", formatv("{0}", std::move(var)).str());
645 EXPECT_EQ("Format", formatv("F{0}t", formatv("o{0}a", "rm")).str());
646 EXPECT_EQ("[ ! ]", formatv("[{0,+5}]", formatv("{0,-2}", "!")).str());
668 EXPECT_EQ("0C 0M", formatv("{0}", R).str());
669 EXPECT_EQ("0C 3M", formatv("{0}", std::move(R)).str());
670 EXPECT_EQ("0C 3M", formatv("{0}", Recorder()).str());
681 EXPECT_EQ("X", formatv("{0}", X).str());
686 EXPECT_EQ("X", formatv("{0}", E1).str());
688 EXPECT_EQ("X", formatv("{0}", fmt_consume(std::move(E1))).str());
unittests/Support/JSONTest.cpp 20 std::string s(const Value &E) { return llvm::formatv("{0}", E).str(); }
21 std::string sp(const Value &E) { return llvm::formatv("{0:2}", E).str(); }