Lines Matching +full:llvm +full:- +full:builddir

1 /* c-index-test.c */
3 #include "clang-c/BuildSystem.h"
4 #include "clang-c/CXCompilationDatabase.h"
5 #include "clang-c/CXErrorCode.h"
6 #include "clang-c/CXSourceLocation.h"
7 #include "clang-c/CXString.h"
8 #include "clang-c/Documentation.h"
9 #include "clang-c/Index.h"
11 #include "llvm/Support/AutoConvert.h"
51 #pragma clang diagnostic ignored "-Wcast-qual"
193 /** Returns 0 in case of success, non-zero in case of a failure. */
222 fprintf(out, "[%d:%d - %d:%d]", begin_line, begin_column,
244 #pragma GCC diagnostic ignored "-Wcast-qual"
247 #pragma clang diagnostic ignored "-Wcast-qual"
303 return -1;
314 return -1;
319 unsaved->Length = ftell(to_file);
323 contents = (char *)malloc(unsaved->Length + 1);
325 if (fread(contents, 1, unsaved->Length, to_file) != unsaved->Length) {
333 return -1;
335 contents[unsaved->Length] = 0;
336 unsaved->Contents = contents;
342 filename_len = sep - arg_string;
347 unsaved->Filename = filename;
356 return parse_remapped_files_with_opt("-remap-file=", argc, argv, start_arg,
377 sprintf(opt_name, "-remap-file-%d=", try_idx);
408 const char *CommentsSchemaArg = "-comments-xml-schema=";
421 /* Pretty-printing. */
509 Ctx->IndentLevel++;
510 for (i = 0, e = Ctx->IndentLevel; i != e; ++i)
640 if (i != e - 1)
678 Ctx->IndentLevel--;
711 printf(" CommentXMLInvalid [not well-formed XML: %s]", Error->message);
721 printf(" CommentXMLInvalid [not valid XML: %s]", Error->message);
781 if (lhs->line != rhs->line)
782 return (int)lhs->line - (int)rhs->line;
783 return (int)lhs->col - (int)rhs->col;
958 printf(" (copy-assignment operator)");
960 printf(" (move-assignment operator)");
996 printf(" (computed-noexcept)");
1120 printf(" [multi-include guarded]");
1266 fprintf(stderr, "Number FIX-ITs = %d\n", num_fixits);
1279 fprintf(out, "FIX-IT: Insert \"%s\" at %d:%d\n",
1284 fprintf(out, "FIX-IT: Remove ");
1291 fprintf(out, "FIX-IT: Replace ");
1355 if (!Data->Filter || (Cursor.kind == *(enum CXCursorKind *)Data->Filter)) {
1361 PrintCursor(Cursor, Data->CommentSchemaFile);
1424 = clang_getLocation(Data->TU, file, curLine, curColumn);
1425 Ref = clang_getCursor(Data->TU, RefLoc);
1431 PrintCursor(Ref, Data->CommentSchemaFile);
1449 if (!Data->Filter || (C.kind == *(enum CXCursorKind *)Data->Filter)) {
1574 if (NumTArgs != -1 && NumTArgs != 0) {
1584 /* Ensure that the returned type is invalid when indexing off-by-one. */
1633 printf(" lvalue-ref-qualifier");
1635 printf(" rvalue-ref-qualifier");
1670 if (NumArgs != -1 && NumArgs != 0) {
1718 /* Print if this is a non-POD type. */
1769 if (Size >= 0 || Size < -1 ) {
1776 if (Align >= 0 || Align < -1) {
1892 for (I = 0, E = Manglings->Count; I < E; ++I)
1893 printf(" [mangled=%s]", clang_getCString(Manglings->Strings[I]));
1899 for (I = 0, E = Manglings->Count; I < E; ++I)
1900 printf(" [mangled=%s]", clang_getCString(Manglings->Strings[I]));
2036 else if (!strcmp(filter, "all-display") ||
2037 !strcmp(filter, "local-display")) {
2041 else if (!strcmp(filter, "all-pretty") ||
2042 !strcmp(filter, "local-pretty")) {
2052 else if (!strcmp(filter, "scan-function")) Visitor = FunctionScanVisitor;
2054 fprintf(stderr, "Unknown filter for -test-load-tu: %s\n", filter);
2070 return -1;
2113 !strcmp(filter, "local-display") ||
2114 !strcmp(filter, "local-pretty"))
2119 return -1;
2122 argc--;
2128 return -1;
2136 argc - num_unsaved_files,
2149 return -1;
2194 return -1;
2198 if (strcmp(argv[i], "--") == 0)
2206 /* Load the initial translation unit -- we do this without honoring remapped
2210 argc - compiler_arg_idx,
2221 return -1;
2248 return -1;
2262 return -1;
2266 return -1;
2342 printf("-%s", prefix);
2412 /* Parse file:line:column from the input string. Returns 0 on success, non-zero
2413 on failure. If successful, the pointer *filename will contain newly-allocated
2437 values[num_values - i - 1] = strtol(last_colon + 1, &endptr, 10);
2448 prev_colon = last_colon - 1;
2450 --prev_colon;
2469 *filename = (char*)malloc(last_colon - input + 1);
2471 memcpy(*filename, input, last_colon - input);
2472 (*filename)[last_colon - input] = 0;
2522 return -1;
2579 fprintf(file, "-");
2591 CXCompletionResult *completion_result = completion_results->Results + index;
2592 CXString ks = clang_getCursorKindSpelling(completion_result->CursorKind);
2604 print_completion_string(completion_result->CompletionString, file);
2606 clang_getCompletionPriority(completion_result->CompletionString));
2607 switch (clang_getCompletionAvailability(completion_result->CompletionString)){
2625 completion_result->CompletionString);
2633 clang_getCompletionAnnotation(completion_result->CompletionString, i);
2641 ParentName = clang_getCompletionParent(completion_result->CompletionString,
2654 completion_result->CompletionString);
2666 fprintf(file, " (requires fix-it: ");
2688 fprintf(file, "Objective-C object value\n");
2691 fprintf(file, "Objective-C selector value\n");
2703 fprintf(file, "Objective-C property access\n");
2724 fprintf(file, "Objective-C interface\n");
2727 fprintf(file, "Objective-C protocol\n");
2730 fprintf(file, "Objective-C category\n");
2733 fprintf(file, "Objective-C instance method\n");
2736 fprintf(file, "Objective-C class method\n");
2739 fprintf(file, "Objective-C selector name\n");
2774 input += strlen("-code-completion-timing=");
2776 input += strlen("-code-completion-at=");
2783 return -1;
2787 return -1;
2794 argc - num_unsaved_files - 2,
2820 if (I != Repeats-1)
2825 unsigned i, n = results->NumResults, containerIsIncomplete = 0;
2831 /* Sort the code-completion results based on the typed text. */
2832 clang_sortCodeCompletionResults(results->Results, results->NumResults);
2872 printf("Objective-C selector: %s\n", selectorString);
2929 return -1;
2937 Err = clang_parseTranslationUnit2(CIdx, argv[argc - 1],
2939 argc - num_unsaved_files - 2 - NumLocations,
2946 return -1;
2950 return -1;
2964 return -1;
2976 return -1;
3020 if (clang_Cursor_getObjCSelectorIndex(Cursor) != -1)
3024 printf(" Dynamic-call");
3030 printf(" Receiver-type=%s", clang_getCString(S));
3205 while (strstr(argv[NumLocations+1], "-file-refs-at=") == argv[NumLocations+1])
3214 const char *input = argv[Loc + 1] + strlen("-file-refs-at=");
3223 return -1;
3231 Err = clang_parseTranslationUnit2(CIdx, argv[argc - 1],
3233 argc - num_unsaved_files - 2 - NumLocations,
3241 return -1;
3245 return -1;
3259 return -1;
3271 return -1;
3281 return -1;
3314 while (strstr(argv[NumFilenames+1], "-file-includes-in=") == argv[NumFilenames+1])
3322 const char *input = argv[I + 1] + strlen("-file-includes-in=");
3329 return -1;
3338 CIdx, argv[argc - 1],
3340 argc - num_unsaved_files - 2 - NumFilenames,
3348 return -1;
3352 return -1;
3366 return -1;
3374 return -1;
3381 return -1;
3405 p->filenames = malloc(MAX_IMPORTED_ASTFILES * sizeof(const char *));
3406 assert(p->filenames);
3407 p->num_files = 0;
3416 for (i = 0; i < p->num_files; ++i)
3417 free(p->filenames[i]);
3418 free(p->filenames);
3425 for (i = 0; i < p->num_files; ++i)
3426 if (strcmp(file, p->filenames[i]) == 0)
3428 assert(p->num_files + 1 < MAX_IMPORTED_ASTFILES);
3429 p->filenames[p->num_files++] = strdup(file);
3449 IndexDataStringList *node = index_data->strings;
3451 IndexDataStringList *next = node->next;
3455 index_data->strings = NULL;
3459 if (data->check_prefix) {
3460 if (data->first_check_printed) {
3461 printf("// %s-NEXT: ", data->check_prefix);
3463 printf("// %s : ", data->check_prefix);
3464 data->first_check_printed = 1;
3496 main_filename = clang_getCString(index_data->main_filename);
3530 name = info->name;
3532 name = "<anon-tag>";
3540 newStr = node->data;
3545 node->next = index_data->strings;
3546 index_data->strings = node;
3568 case CXIdxEntity_ObjCClass: return "objc-class";
3569 case CXIdxEntity_ObjCProtocol: return "objc-protocol";
3570 case CXIdxEntity_ObjCCategory: return "objc-category";
3571 case CXIdxEntity_ObjCInstanceMethod: return "objc-instance-method";
3572 case CXIdxEntity_ObjCClassMethod: return "objc-class-method";
3573 case CXIdxEntity_ObjCProperty: return "objc-property";
3574 case CXIdxEntity_ObjCIvar: return "objc-ivar";
3578 case CXIdxEntity_CXXClass: return "c++-class";
3580 case CXIdxEntity_CXXNamespaceAlias: return "namespace-alias";
3581 case CXIdxEntity_CXXStaticVariable: return "c++-static-var";
3582 case CXIdxEntity_CXXStaticMethod: return "c++-static-method";
3583 case CXIdxEntity_CXXInstanceMethod: return "c++-instance-method";
3586 case CXIdxEntity_CXXConversionFunction: return "conversion-func";
3587 case CXIdxEntity_CXXTypeAlias: return "type-alias";
3588 case CXIdxEntity_CXXInterface: return "c++-__interface";
3599 case CXIdxEntity_Template: return "-template";
3601 return "-template-partial-spec";
3602 case CXIdxEntity_TemplateSpecialization: return "-template-spec";
3634 name = info->name;
3636 name = "<anon-tag>";
3638 printf("%s: kind: %s%s", cb, getEntityKindString(info->kind),
3639 getEntityTemplateKindString(info->templateKind));
3641 printf(" | USR: %s", info->USR);
3642 printf(" | lang: %s", getEntityLanguageString(info->lang));
3644 for (i = 0; i != info->numAttributes; ++i) {
3645 const CXIdxAttrInfo *Attr = info->attributes[i];
3647 PrintCursor(Attr->cursor, NULL);
3653 printEntityInfo(" <base>", client_data, info->base);
3655 PrintCursor(info->cursor, NULL);
3657 printCXIndexLoc(info->loc, client_data);
3663 for (i = 0; i < ProtoInfo->numProtocols; ++i) {
3665 ProtoInfo->protocols[i]->protocol);
3667 PrintCursor(ProtoInfo->protocols[i]->cursor, NULL);
3669 printCXIndexLoc(ProtoInfo->protocols[i]->loc, client_data);
3715 index_data->fail_for_error = 1;
3727 index_data->main_filename = clang_getFileName(file);
3744 printCXIndexFile((CXIdxClientFile)info->file);
3745 printf(" | name: \"%s\"", info->filename);
3747 printCXIndexLoc(info->hashLoc, client_data);
3749 info->isImport, info->isAngled, info->isModuleImport);
3751 Mod = clang_getModuleForFile(index_data->TU, (CXFile)info->file);
3761 return (CXIdxClientFile)info->file;
3770 if (index_data->importedASTs) {
3771 CXString filename = clang_getFileName(info->file);
3772 importedASTS_insert(index_data->importedASTs, clang_getCString(filename));
3777 printCXIndexFile((CXIdxClientFile)info->file);
3778 if (info->module) {
3779 CXString name = clang_Module_getFullName(info->module);
3781 printCXIndexLoc(info->loc, client_data);
3783 printf(" | isImplicit: %d\n", info->isImplicit);
3790 return (CXIdxClientFile)info->file;
3802 #pragma GCC diagnostic ignored "-Wcast-qual"
3821 printEntityInfo("[indexDeclaration]", client_data, info->entityInfo);
3823 PrintCursor(info->cursor, NULL);
3825 printCXIndexLoc(info->loc, client_data);
3826 printf(" | semantic-container: ");
3827 printCXIndexContainer(info->semanticContainer);
3828 printf(" | lexical-container: ");
3829 printCXIndexContainer(info->lexicalContainer);
3830 printf(" | isRedecl: %d", info->isRedeclaration);
3831 printf(" | isDef: %d", info->isDefinition);
3832 if (info->flags & CXIdxDeclFlag_Skipped) {
3833 assert(!info->isContainer);
3836 printf(" | isContainer: %d", info->isContainer);
3838 printf(" | isImplicit: %d\n", info->isImplicit);
3840 for (i = 0; i != info->numAttributes; ++i) {
3841 const CXIdxAttrInfo *Attr = info->attributes[i];
3843 PrintCursor(Attr->cursor, NULL);
3847 if (clang_index_isEntityObjCContainerKind(info->entityInfo->kind)) {
3849 CXIdxObjCContainerKind K = clang_index_getObjCContainerDeclInfo(info)->kind;
3852 kindName = "forward-ref"; break;
3864 CatInfo->objcClass);
3866 PrintCursor(CatInfo->classCursor, NULL);
3868 printCXIndexLoc(CatInfo->classLoc, client_data);
3873 if (InterInfo->superInfo) {
3874 printBaseClassInfo(client_data, InterInfo->superInfo);
3884 if (PropInfo->getter) {
3885 printEntityInfo(" <getter>", client_data, PropInfo->getter);
3888 if (PropInfo->setter) {
3889 printEntityInfo(" <setter>", client_data, PropInfo->setter);
3895 for (i = 0; i != CXXClassInfo->numBases; ++i) {
3896 printBaseClassInfo(client_data, CXXClassInfo->bases[i]);
3901 if (info->declAsContainer)
3903 info->declAsContainer,
3904 makeClientContainer(client_data, info->entityInfo, info->loc));
3910 info->referencedEntity);
3912 PrintCursor(info->cursor, NULL);
3914 printCXIndexLoc(info->loc, client_data);
3915 printEntityInfo(" | <parent>:", client_data, info->parentEntity);
3917 printCXIndexContainer(info->container);
3919 switch (info->kind) {
3924 printSymbolRole(info->role);
3931 return index_data->abort;
3970 return -1;
3991 result = -1;
4009 return -1;
4025 result = -1;
4042 if (strstr(argv[0], "-check-prefix=") == argv[0]) {
4043 check_prefix = argv[0] + strlen("-check-prefix=");
4045 --argc;
4065 for (i = 0; i < importedASTs->num_files && result == 0; ++i) {
4066 result = index_ast_file(importedASTs->filenames[i], Idx, idxAction,
4086 if (strstr(argv[0], "-check-prefix=") == argv[0]) {
4087 check_prefix = argv[0] + strlen("-check-prefix=");
4089 --argc;
4116 if (strstr(argv[0], "-check-prefix=") == argv[0]) {
4117 check_prefix = argv[0] + strlen("-check-prefix=");
4119 --argc;
4125 return -1;
4147 char *buildDir;
4154 buildDir = dirname(tmp);
4156 db = clang_CompilationDatabase_fromDirectory(buildDir, &ec);
4162 errorCode = -1;
4166 if (chdir(buildDir) != 0) {
4167 printf("Could not chdir to %s\n", buildDir);
4168 errorCode = -1;
4175 errorCode = -1;
4183 errorCode = -1;
4193 errorCode = -1;
4201 errorCode = -1;
4217 errorCode = -1;
4252 input += strlen("-test-annotate-tokens=");
4259 return -1;
4263 Err = clang_parseTranslationUnit2(CIdx, argv[argc - 1],
4265 argc - num_unsaved_files - 3,
4275 return -1;
4280 errorCode = -1;
4291 errorCode = -1;
4298 errorCode = -1;
4305 errorCode = -1;
4313 errorCode = -1;
4321 errorCode = -1;
4329 errorCode = -1;
4338 errorCode = -1;
4343 for (i = 0; i != skipped_ranges->count; ++i) {
4345 clang_getFileLocation(clang_getRangeStart(skipped_ranges->ranges[i]), 0,
4347 clang_getFileLocation(clang_getRangeEnd(skipped_ranges->ranges[i]), 0,
4404 char *buildDir;
4411 buildDir = dirname(tmp);
4413 db = clang_CompilationDatabase_fromDirectory(buildDir, &ec);
4419 errorCode = -1;
4429 errorCode = -1;
4438 errorCode = -1;
4468 errorCode = -1;
4502 fprintf(stderr, "-print-usrs options:\n"
4657 return -1;
4661 Idx, 0, argv + num_unsaved_files, argc - num_unsaved_files,
4735 --indent;
4737 fprintf(stderr, "-");
4738 --indent;
4783 fprintf(stderr, " - ");
4886 usr = input + strlen("-single-symbol-sgf-for=");
4891 return -1;
4894 result = -1;
4899 Idx, 0, argv + num_unsaved_files, argc - num_unsaved_files, unsaved_files,
4953 if (strcmp(s, "-usrs") == 0)
4955 if (strncmp(s, "-memory-usage", 13) == 0)
4962 "usage: c-index-test -code-completion-at=<site> <compiler arguments>\n"
4963 " c-index-test -code-completion-timing=<site> <compiler arguments>\n"
4964 " c-index-test -cursor-at=<site> <compiler arguments>\n"
4965 " c-index-test -evaluate-cursor-at=<site> <compiler arguments>\n"
4966 " c-index-test -get-macro-info-cursor-at=<site> <compiler arguments>\n"
4967 " c-index-test -file-refs-at=<site> <compiler arguments>\n"
4968 " c-index-test -file-includes-in=<filename> <compiler arguments>\n");
4970 " c-index-test -index-file [-check-prefix=<FileCheck prefix>] <compiler arguments>\n"
4971 " c-index-test -index-file-full [-check-prefix=<FileCheck prefix>] <compiler arguments>\n"
4972 " c-index-test -index-tu [-check-prefix=<FileCheck prefix>] <AST file>\n"
4973 " c-index-test -index-compile-db [-check-prefix=<FileCheck prefix>] <compilation database>\n"
4974 " c-index-test -test-file-scan <AST file> <source file> "
4977 " c-index-test -test-load-tu <AST file> <symbol filter> "
4979 " c-index-test -test-load-tu-usrs <AST file> <symbol filter> "
4981 " c-index-test -test-load-source <symbol filter> {<args>}*\n");
4983 " c-index-test -test-load-source-memory-usage "
4985 " c-index-test -test-load-source-reparse <trials> <symbol filter> "
4987 " c-index-test -test-load-source-usrs <symbol filter> {<args>}*\n"
4988 " c-index-test -test-load-source-usrs-memory-usage "
4990 " c-index-test -test-annotate-tokens=<range> {<args>}*\n"
4991 " c-index-test -test-inclusion-stack-source {<args>}*\n"
4992 " c-index-test -test-inclusion-stack-tu <AST file>\n");
4994 " c-index-test -test-print-linkage-source {<args>}*\n"
4995 " c-index-test -test-print-visibility {<args>}*\n"
4996 " c-index-test -test-print-type {<args>}*\n"
4997 " c-index-test -test-print-type-size {<args>}*\n"
4998 " c-index-test -test-print-bitwidth {<args>}*\n"
4999 " c-index-test -test-print-target-info {<args>}*\n"
5000 " c-index-test -test-print-type-declaration {<args>}*\n"
5001 " c-index-test -print-usr [<CursorKind> {<args>}]*\n"
5002 " c-index-test -print-usr-file <file>\n");
5004 " c-index-test -single-symbol-sgfs <symbol filter> {<args>*}\n"
5005 " c-index-test -single-symbol-sgf-at=<site> {<args>*}\n"
5006 " c-index-test -single-symbol-sgf-for=<usr> {<args>}*\n");
5008 " c-index-test -write-pch <file> <compiler arguments>\n"
5009 " c-index-test -compilation-db [lookup <filename>] database\n");
5011 " c-index-test -print-build-session-timestamp\n");
5013 " c-index-test -read-diagnostics <file>\n\n");
5016 " all - load all symbols, including those from PCH\n"
5017 " local - load all symbols except those in PCH\n"
5018 " category - only load ObjC categories (non-PCH)\n"
5019 " interface - only load ObjC interfaces (non-PCH)\n"
5020 " protocol - only load ObjC protocols (non-PCH)\n"
5021 " function - only load functions (non-PCH)\n"
5022 " typedef - only load typdefs (non-PCH)\n"
5023 " scan-function - scan function bodies (non-PCH)\n\n");
5030 if (argc > 2 && strcmp(argv[1], "-read-diagnostics") == 0)
5032 if (argc > 2 && strstr(argv[1], "-code-completion-at=") == argv[1])
5034 if (argc > 2 && strstr(argv[1], "-code-completion-timing=") == argv[1])
5036 if (argc > 2 && strstr(argv[1], "-cursor-at=") == argv[1])
5037 return inspect_cursor_at(argc, argv, "-cursor-at=", inspect_print_cursor);
5038 if (argc > 2 && strstr(argv[1], "-evaluate-cursor-at=") == argv[1])
5039 return inspect_cursor_at(argc, argv, "-evaluate-cursor-at=",
5041 if (argc > 2 && strstr(argv[1], "-get-macro-info-cursor-at=") == argv[1])
5042 return inspect_cursor_at(argc, argv, "-get-macro-info-cursor-at=",
5044 if (argc > 2 && strstr(argv[1], "-file-refs-at=") == argv[1])
5046 if (argc > 2 && strstr(argv[1], "-file-includes-in=") == argv[1])
5048 if (argc > 2 && strcmp(argv[1], "-index-file") == 0)
5049 return index_file(argc - 2, argv + 2, /*full=*/0);
5050 if (argc > 2 && strcmp(argv[1], "-index-file-full") == 0)
5051 return index_file(argc - 2, argv + 2, /*full=*/1);
5052 if (argc > 2 && strcmp(argv[1], "-index-tu") == 0)
5053 return index_tu(argc - 2, argv + 2);
5054 if (argc > 2 && strcmp(argv[1], "-index-compile-db") == 0)
5055 return index_compile_db(argc - 2, argv + 2);
5056 else if (argc >= 4 && strncmp(argv[1], "-test-load-tu", 13) == 0) {
5062 else if (argc >= 5 && strncmp(argv[1], "-test-load-source-reparse", 25) == 0){
5066 return perform_test_reparse_source(argc - 4, argv + 4, trials, argv[3], I,
5070 else if (argc >= 4 && strncmp(argv[1], "-test-load-source", 17) == 0) {
5074 if (strstr(argv[1], "-memory-usage"))
5078 return perform_test_load_source(argc - 3, argv + 3, argv[2], I,
5081 else if (argc >= 3 && strcmp(argv[1], "-single-file-parse") == 0)
5083 else if (argc >= 3 && strcmp(argv[1], "-retain-excluded-conditional-blocks") == 0)
5085 else if (argc >= 4 && strcmp(argv[1], "-test-file-scan") == 0)
5088 else if (argc > 2 && strstr(argv[1], "-test-annotate-tokens=") == argv[1])
5090 else if (argc > 2 && strcmp(argv[1], "-test-inclusion-stack-source") == 0)
5091 return perform_test_load_source(argc - 2, argv + 2, "all", NULL,
5093 else if (argc > 2 && strcmp(argv[1], "-test-inclusion-stack-tu") == 0)
5096 else if (argc > 2 && strcmp(argv[1], "-test-print-linkage-source") == 0)
5097 return perform_test_load_source(argc - 2, argv + 2, "all", PrintLinkage,
5099 else if (argc > 2 && strcmp(argv[1], "-test-print-visibility") == 0)
5100 return perform_test_load_source(argc - 2, argv + 2, "all", PrintVisibility,
5102 else if (argc > 2 && strcmp(argv[1], "-test-print-type") == 0)
5103 return perform_test_load_source(argc - 2, argv + 2, "all",
5105 else if (argc > 2 && strcmp(argv[1], "-test-print-type-size") == 0)
5106 return perform_test_load_source(argc - 2, argv + 2, "all",
5108 else if (argc > 2 && strcmp(argv[1], "-test-print-type-declaration") == 0)
5109 return perform_test_load_source(argc - 2, argv + 2, "all",
5111 else if (argc > 2 && strcmp(argv[1], "-test-print-decl-attributes") == 0)
5112 return perform_test_load_source(argc - 2, argv + 2, "all",
5114 else if (argc > 2 && strcmp(argv[1], "-test-print-bitwidth") == 0)
5115 return perform_test_load_source(argc - 2, argv + 2, "all",
5117 else if (argc > 2 && strcmp(argv[1], "-test-print-binops") == 0)
5118 return perform_test_load_source(argc - 2, argv + 2, "all", PrintBinOps, 0);
5119 else if (argc > 2 && strcmp(argv[1], "-test-print-mangle") == 0)
5121 else if (argc > 2 && strcmp(argv[1], "-test-print-manglings") == 0)
5123 else if (argc > 2 && strcmp(argv[1], "-test-print-target-info") == 0)
5124 return print_target_info(argc - 2, argv + 2);
5125 else if (argc > 1 && strcmp(argv[1], "-print-usr") == 0) {
5133 else if (argc > 2 && strcmp(argv[1], "-print-usr-file") == 0)
5135 else if (argc > 2 && strcmp(argv[1], "-write-pch") == 0)
5136 return write_pch_file(argv[2], argc - 3, argv + 3);
5137 else if (argc > 2 && strcmp(argv[1], "-compilation-db") == 0)
5138 return perform_test_compilation_db(argv[argc-1], argc - 3, argv + 2);
5139 else if (argc == 2 && strcmp(argv[1], "-print-build-session-timestamp") == 0)
5141 else if (argc > 3 && strcmp(argv[1], "-single-symbol-sgfs") == 0)
5142 return perform_test_load_source(argc - 3, argv + 3, argv[2],
5144 else if (argc > 2 && strstr(argv[1], "-single-symbol-sgf-at=") == argv[1])
5146 argc, argv, "-single-symbol-sgf-at=", inspect_single_symbol_sgf_cursor);
5147 else if (argc > 2 && strstr(argv[1], "-single-symbol-sgf-for=") == argv[1])
5148 return perform_test_single_symbol_sgf(argv[1], argc - 2, argv + 2);
5168 client_data->result = client_data->main_func(client_data->argc,
5169 client_data->argv);
5183 if (enablezOSAutoConversion(fileno(stdout)) == -1)
5186 if (enablezOSAutoConversion(fileno(stderr)) == -1)