[cfe-commits] r159469 - in /cfe/trunk: include/clang/Basic/TokenKinds.def include/clang/Driver/Compilation.h include/clang/Driver/Types.def lib/Driver/Driver.cpp lib/Lex/Pragma.cpp lib/Parse/ParseDecl.cpp test/Driver/crash-report.c
David Dean
david_dean at apple.com
Fri Jun 29 15:55:38 PDT 2012
The test case is failing:
******************** TEST 'Clang :: Driver/crash-report.c' FAILED ********************Script:
--
/Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-nobootstrap-RA/clang-build/Release+Asserts/bin/clang -fsyntax-only /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-nobootstrap-RA/clang.src/test/Driver/crash-report.c 2>&1 | FileCheck /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-nobootstrap-RA/clang.src/test/Driver/crash-report.c
--
Exit Code: 1
Command Output (stderr):
--
/Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-nobootstrap-RA/clang.src/test/Driver/crash-report.c:6:16: error: expected string not found in input
// CHECK-NEXT: clang-3: note: diagnostic msg: {{.*}}.c
^
<stdin>:33:1: note: scanning from here
clang: note: diagnostic msg: /tmp/crash-report-sfgAhA.c
^
<stdin>:35:1: note: possible intended match here
clang: note: diagnostic msg:
^
--
********************
On 29 Jun 2012, at 3:03 PM, David Blaikie wrote:
> Author: dblaikie
> Date: Fri Jun 29 17:03:56 2012
> New Revision: 159469
>
> URL: http://llvm.org/viewvc/llvm-project?rev=159469&view=rev
> Log:
> Use -frewrite-includes for crash reports.
>
> In future changes we should:
> * use __builtin_trap rather than derefing 'random' volatile pointers.
> * avoid dumping temporary files into /tmp when running tests, instead
> preferring a location that is properly cleaned up by lit.
>
> Review by Chandler Carruth.
>
> Added:
> cfe/trunk/test/Driver/crash-report.c
> Modified:
> cfe/trunk/include/clang/Basic/TokenKinds.def
> cfe/trunk/include/clang/Driver/Compilation.h
> cfe/trunk/include/clang/Driver/Types.def
> cfe/trunk/lib/Driver/Driver.cpp
> cfe/trunk/lib/Lex/Pragma.cpp
> cfe/trunk/lib/Parse/ParseDecl.cpp
>
> Modified: cfe/trunk/include/clang/Basic/TokenKinds.def
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TokenKinds.def?rev=159469&r1=159468&r2=159469&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Basic/TokenKinds.def (original)
> +++ cfe/trunk/include/clang/Basic/TokenKinds.def Fri Jun 29 17:03:56 2012
> @@ -592,6 +592,11 @@
> // handles them.
> ANNOTATION(pragma_pack)
>
> +// Annotation for #pragma clang __debug parser_crash...
> +// The lexer produces these so that they only take effect when the parser
> +// handles them.
> +ANNOTATION(pragma_parser_crash)
> +
> #undef ANNOTATION
> #undef TESTING_KEYWORD
> #undef OBJC2_AT_KEYWORD
>
> Modified: cfe/trunk/include/clang/Driver/Compilation.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Compilation.h?rev=159469&r1=159468&r2=159469&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Driver/Compilation.h (original)
> +++ cfe/trunk/include/clang/Driver/Compilation.h Fri Jun 29 17:03:56 2012
> @@ -76,6 +76,8 @@
>
> const DerivedArgList &getArgs() const { return *TranslatedArgs; }
>
> + DerivedArgList &getArgs() { return *TranslatedArgs; }
> +
> ActionList &getActions() { return Actions; }
> const ActionList &getActions() const { return Actions; }
>
>
> Modified: cfe/trunk/include/clang/Driver/Types.def
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Types.def?rev=159469&r1=159468&r2=159469&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Driver/Types.def (original)
> +++ cfe/trunk/include/clang/Driver/Types.def Fri Jun 29 17:03:56 2012
> @@ -40,17 +40,17 @@
>
> // C family source language (with and without preprocessing).
> TYPE("cpp-output", PP_C, INVALID, "i", "u")
> -TYPE("c", C, PP_C, 0, "u")
> -TYPE("cl", CL, PP_C, 0, "u")
> -TYPE("cuda", CUDA, PP_CXX, 0, "u")
> +TYPE("c", C, PP_C, "c", "u")
> +TYPE("cl", CL, PP_C, "cl", "u")
> +TYPE("cuda", CUDA, PP_CXX, "cpp", "u")
> TYPE("objective-c-cpp-output", PP_ObjC, INVALID, "mi", "u")
> TYPE("objc-cpp-output", PP_ObjC_Alias, INVALID, "mi", "u")
> -TYPE("objective-c", ObjC, PP_ObjC, 0, "u")
> +TYPE("objective-c", ObjC, PP_ObjC, "m", "u")
> TYPE("c++-cpp-output", PP_CXX, INVALID, "ii", "u")
> -TYPE("c++", CXX, PP_CXX, 0, "u")
> +TYPE("c++", CXX, PP_CXX, "cpp", "u")
> TYPE("objective-c++-cpp-output", PP_ObjCXX, INVALID, "mii", "u")
> TYPE("objc++-cpp-output", PP_ObjCXX_Alias, INVALID, "mii", "u")
> -TYPE("objective-c++", ObjCXX, PP_ObjCXX, 0, "u")
> +TYPE("objective-c++", ObjCXX, PP_ObjCXX, "mm", "u")
>
> // C family input files to precompile.
> TYPE("c-header-cpp-output", PP_CHeader, INVALID, "i", "p")
>
> Modified: cfe/trunk/lib/Driver/Driver.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=159469&r1=159468&r2=159469&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Driver/Driver.cpp (original)
> +++ cfe/trunk/lib/Driver/Driver.cpp Fri Jun 29 17:03:56 2012
> @@ -392,6 +392,7 @@
> // Suppress driver output and emit preprocessor output to temp file.
> CCCIsCPP = true;
> CCGenDiagnostics = true;
> + C.getArgs().AddFlagArg(0, Opts->getOption(options::OPT_frewrite_includes));
>
> // Save the original job command(s).
> std::string Cmd;
> @@ -1181,7 +1182,10 @@
> if (Args.hasArg(options::OPT_M, options::OPT_MM)) {
> OutputTy = types::TY_Dependencies;
> } else {
> - OutputTy = types::getPreprocessedType(Input->getType());
> + OutputTy = Input->getType();
> + if (!Args.hasFlag(options::OPT_frewrite_includes,
> + options::OPT_fno_rewrite_includes, false))
> + OutputTy = types::getPreprocessedType(OutputTy);
> assert(OutputTy != types::TY_INVALID &&
> "Cannot preprocess this input type!");
> }
>
> Modified: cfe/trunk/lib/Lex/Pragma.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Pragma.cpp?rev=159469&r1=159468&r2=159469&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Lex/Pragma.cpp (original)
> +++ cfe/trunk/lib/Lex/Pragma.cpp Fri Jun 29 17:03:56 2012
> @@ -1010,6 +1010,10 @@
> llvm_unreachable("This is an assertion!");
> } else if (II->isStr("crash")) {
> *(volatile int*) 0x11 = 0;
> + } else if (II->isStr("parser_crash")) {
> + Token Crasher;
> + Crasher.setKind(tok::annot_pragma_parser_crash);
> + PP.EnterToken(Crasher);
> } else if (II->isStr("llvm_fatal_error")) {
> llvm::report_fatal_error("#pragma clang __debug llvm_fatal_error");
> } else if (II->isStr("llvm_unreachable")) {
>
> Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=159469&r1=159468&r2=159469&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
> +++ cfe/trunk/lib/Parse/ParseDecl.cpp Fri Jun 29 17:03:56 2012
> @@ -4252,6 +4252,8 @@
> // portion is empty), if an abstract-declarator is allowed.
> D.SetIdentifier(0, Tok.getLocation());
> } else {
> + if (Tok.getKind() == tok::annot_pragma_parser_crash)
> + *(volatile int*) 0x11 = 0;
> if (D.getContext() == Declarator::MemberContext)
> Diag(Tok, diag::err_expected_member_name_or_semi)
> << D.getDeclSpec().getSourceRange();
>
> Added: cfe/trunk/test/Driver/crash-report.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/crash-report.c?rev=159469&view=auto
> ==============================================================================
> --- cfe/trunk/test/Driver/crash-report.c (added)
> +++ cfe/trunk/test/Driver/crash-report.c Fri Jun 29 17:03:56 2012
> @@ -0,0 +1,6 @@
> +// RUN: %clang -fsyntax-only %s 2>&1 | FileCheck %s
> +// REQUIRES: crash-recovery
> +
> +#pragma clang __debug parser_crash
> +// CHECK: Preprocessed source(s) and associated run script(s) are located at:
> +// CHECK-NEXT: clang-3: note: diagnostic msg: {{.*}}.c
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
-David
More information about the cfe-commits
mailing list