Index: lib/Frontend/PrintPreprocessedOutput.cpp =================================================================== --- lib/Frontend/PrintPreprocessedOutput.cpp +++ lib/Frontend/PrintPreprocessedOutput.cpp @@ -555,7 +555,7 @@ PragmaAssumeNonNullBegin(SourceLocation Loc) { startNewLineIfNeeded(); MoveToLine(Loc); - OS << "#pragma " << "clang assume_nonnull begin"; + OS << "#pragma clang assume_nonnull begin"; setEmittedDirectiveOnThisLine(); } @@ -563,7 +563,7 @@ PragmaAssumeNonNullEnd(SourceLocation Loc) { startNewLineIfNeeded(); MoveToLine(Loc); - OS << "#pragma " << "clang assume_nonnull end"; + OS << "#pragma clang assume_nonnull end"; setEmittedDirectiveOnThisLine(); } Index: test/Preprocessor/pragma_assume_nonnull.c =================================================================== --- test/Preprocessor/pragma_assume_nonnull.c +++ test/Preprocessor/pragma_assume_nonnull.c @@ -1,23 +1,13 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s // RUN: %clang_cc1 -E %s | FileCheck %s -#ifndef NS_ASSUME_NONNULL_BEGIN -#if __has_feature(assume_nonnull) -#define NS_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin") -#define NS_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end") -#else -#define NS_ASSUME_NONNULL_BEGIN -#define NS_ASSUME_NONNULL_END -#endif -#endif - // CHECK: #pragma clang assume_nonnull begin -NS_ASSUME_NONNULL_BEGIN +#pragma clang assume_nonnull begin int bar(int * ip) { return *ip; } // CHECK: #pragma clang assume_nonnull end -NS_ASSUME_NONNULL_END +#pragma clang assume_nonnull end int foo(int * _Nonnull ip) { return *ip; } @@ -28,4 +18,3 @@ return bar(0) + foo(0); // expected-warning {{null passed to a callee that requires a non-null argument}} #endif } -