r305239 - Revert r301742 which made ExprConstant checking apply to all full-exprs.

Diana Picus via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 13 05:52:58 PDT 2017


Hi,

I reverted r305287, since the bots were red for a very long time. More
bots with the same error:
http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15-full/builds/7727
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/5503
http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/9097

Cheers,
Diana

On 13 June 2017 at 07:12, NAKAMURA Takumi via cfe-commits
<cfe-commits at lists.llvm.org> wrote:
> It triggered a test failure for targeting i686 (seems also for arm)
> See also; http://bb.pgr.jp/builders/test-clang-i686-linux-RA/builds/3566
>
> On Tue, Jun 13, 2017 at 6:59 AM Nick Lewycky via cfe-commits
> <cfe-commits at lists.llvm.org> wrote:
>>
>> Author: nicholas
>> Date: Mon Jun 12 16:59:18 2017
>> New Revision: 305239
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=305239&view=rev
>> Log:
>> Revert r301742 which made ExprConstant checking apply to all full-exprs.
>>
>> This patch also exposed pre-existing bugs in clang, see PR32864 and
>> PR33140#c3 .
>>
>> Modified:
>>     cfe/trunk/include/clang/Sema/Sema.h
>>     cfe/trunk/lib/AST/ExprConstant.cpp
>>     cfe/trunk/lib/Sema/SemaChecking.cpp
>>
>> cfe/trunk/test/OpenMP/distribute_parallel_for_simd_aligned_messages.cpp
>>     cfe/trunk/test/OpenMP/distribute_simd_aligned_messages.cpp
>>     cfe/trunk/test/OpenMP/for_simd_aligned_messages.cpp
>>     cfe/trunk/test/OpenMP/parallel_for_simd_aligned_messages.cpp
>>     cfe/trunk/test/OpenMP/simd_aligned_messages.cpp
>>     cfe/trunk/test/OpenMP/target_parallel_for_simd_aligned_messages.cpp
>>     cfe/trunk/test/OpenMP/target_simd_aligned_messages.cpp
>>
>> cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_aligned_messages.cpp
>>
>> cfe/trunk/test/OpenMP/target_teams_distribute_simd_aligned_messages.cpp
>>     cfe/trunk/test/OpenMP/taskloop_simd_aligned_messages.cpp
>>
>> cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_aligned_messages.cpp
>>     cfe/trunk/test/OpenMP/teams_distribute_simd_aligned_messages.cpp
>>     cfe/trunk/test/Sema/integer-overflow.c
>>
>> Modified: cfe/trunk/include/clang/Sema/Sema.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=305239&r1=305238&r2=305239&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/include/clang/Sema/Sema.h (original)
>> +++ cfe/trunk/include/clang/Sema/Sema.h Mon Jun 12 16:59:18 2017
>> @@ -10273,6 +10273,7 @@ private:
>>    void CheckFloatComparison(SourceLocation Loc, Expr* LHS, Expr* RHS);
>>    void CheckImplicitConversions(Expr *E, SourceLocation CC =
>> SourceLocation());
>>    void CheckBoolLikeConversion(Expr *E, SourceLocation CC);
>> +  void CheckForIntOverflow(Expr *E);
>>    void CheckUnsequencedOperations(Expr *E);
>>
>>    /// \brief Perform semantic checks on a completed expression. This will
>> either
>>
>> Modified: cfe/trunk/lib/AST/ExprConstant.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprConstant.cpp?rev=305239&r1=305238&r2=305239&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/lib/AST/ExprConstant.cpp (original)
>> +++ cfe/trunk/lib/AST/ExprConstant.cpp Mon Jun 12 16:59:18 2017
>> @@ -6226,10 +6226,6 @@ bool RecordExprEvaluator::VisitInitListE
>>      // the initializer list.
>>      ImplicitValueInitExpr VIE(HaveInit ? Info.Ctx.IntTy :
>> Field->getType());
>>      const Expr *Init = HaveInit ? E->getInit(ElementNo++) : &VIE;
>> -    if (Init->isValueDependent()) {
>> -      Success = false;
>> -      continue;
>> -    }
>>
>>      // Temporarily override This, in case there's a CXXDefaultInitExpr in
>> here.
>>      ThisOverrideRAII ThisOverride(*Info.CurrentCall, &This,
>> @@ -9940,8 +9936,7 @@ static bool EvaluateAsRValue(EvalInfo &I
>>  }
>>
>>  static bool FastEvaluateAsRValue(const Expr *Exp, Expr::EvalResult
>> &Result,
>> -                                 const ASTContext &Ctx, bool &IsConst,
>> -                                 bool IsCheckingForOverflow) {
>> +                                 const ASTContext &Ctx, bool &IsConst) {
>>    // Fast-path evaluations of integer literals, since we sometimes see
>> files
>>    // containing vast quantities of these.
>>    if (const IntegerLiteral *L = dyn_cast<IntegerLiteral>(Exp)) {
>> @@ -9962,7 +9957,7 @@ static bool FastEvaluateAsRValue(const E
>>    // performance problems. Only do so in C++11 for now.
>>    if (Exp->isRValue() && (Exp->getType()->isArrayType() ||
>>                            Exp->getType()->isRecordType()) &&
>> -      !Ctx.getLangOpts().CPlusPlus11 && !IsCheckingForOverflow) {
>> +      !Ctx.getLangOpts().CPlusPlus11) {
>>      IsConst = false;
>>      return true;
>>    }
>> @@ -9977,7 +9972,7 @@ static bool FastEvaluateAsRValue(const E
>>  /// will be applied to the result.
>>  bool Expr::EvaluateAsRValue(EvalResult &Result, const ASTContext &Ctx)
>> const {
>>    bool IsConst;
>> -  if (FastEvaluateAsRValue(this, Result, Ctx, IsConst, false))
>> +  if (FastEvaluateAsRValue(this, Result, Ctx, IsConst))
>>      return IsConst;
>>
>>    EvalInfo Info(Ctx, Result, EvalInfo::EM_IgnoreSideEffects);
>> @@ -10102,7 +10097,7 @@ APSInt Expr::EvaluateKnownConstInt(const
>>  void Expr::EvaluateForOverflow(const ASTContext &Ctx) const {
>>    bool IsConst;
>>    EvalResult EvalResult;
>> -  if (!FastEvaluateAsRValue(this, EvalResult, Ctx, IsConst, true)) {
>> +  if (!FastEvaluateAsRValue(this, EvalResult, Ctx, IsConst)) {
>>      EvalInfo Info(Ctx, EvalResult, EvalInfo::EM_EvaluateForOverflow);
>>      (void)::EvaluateAsRValue(Info, this, EvalResult.Val);
>>    }
>>
>> Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=305239&r1=305238&r2=305239&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
>> +++ cfe/trunk/lib/Sema/SemaChecking.cpp Mon Jun 12 16:59:18 2017
>> @@ -9935,6 +9935,28 @@ void Sema::CheckBoolLikeConversion(Expr
>>    ::CheckBoolLikeConversion(*this, E, CC);
>>  }
>>
>> +/// Diagnose when expression is an integer constant expression and its
>> evaluation
>> +/// results in integer overflow
>> +void Sema::CheckForIntOverflow (Expr *E) {
>> +  // Use a work list to deal with nested struct initializers.
>> +  SmallVector<Expr *, 2> Exprs(1, E);
>> +
>> +  do {
>> +    Expr *E = Exprs.pop_back_val();
>> +
>> +    if (isa<BinaryOperator>(E->IgnoreParenCasts())) {
>> +      E->IgnoreParenCasts()->EvaluateForOverflow(Context);
>> +      continue;
>> +    }
>> +
>> +    if (auto InitList = dyn_cast<InitListExpr>(E))
>> +      Exprs.append(InitList->inits().begin(), InitList->inits().end());
>> +
>> +    if (isa<ObjCBoxedExpr>(E))
>> +      E->IgnoreParenCasts()->EvaluateForOverflow(Context);
>> +  } while (!Exprs.empty());
>> +}
>> +
>>  namespace {
>>  /// \brief Visitor for expressions which looks for unsequenced operations
>> on the
>>  /// same object.
>> @@ -10436,7 +10458,7 @@ void Sema::CheckCompletedExpr(Expr *E, S
>>    if (!E->isInstantiationDependent())
>>      CheckUnsequencedOperations(E);
>>    if (!IsConstexpr && !E->isValueDependent())
>> -    E->EvaluateForOverflow(Context);
>> +    CheckForIntOverflow(E);
>>    DiagnoseMisalignedMembers();
>>  }
>>
>>
>> Modified:
>> cfe/trunk/test/OpenMP/distribute_parallel_for_simd_aligned_messages.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_parallel_for_simd_aligned_messages.cpp?rev=305239&r1=305238&r2=305239&view=diff
>>
>> ==============================================================================
>> ---
>> cfe/trunk/test/OpenMP/distribute_parallel_for_simd_aligned_messages.cpp
>> (original)
>> +++
>> cfe/trunk/test/OpenMP/distribute_parallel_for_simd_aligned_messages.cpp Mon
>> Jun 12 16:59:18 2017
>> @@ -134,8 +134,9 @@ S3 h; // expected-note 2 {{'h' defined h
>>  template<class I, class C> int foomain(I argc, C **argv) {
>>    I e(argc);
>>    I g(argc);
>> -  int i; // expected-note {{'i' defined here}}
>> -  // expected-note at +1 {{declared here}}
>> +  int i; // expected-note {{declared here}} expected-note {{'i' defined
>> here}}
>> +  // expected-note at +2 {{declared here}}
>> +  // expected-note at +1 {{reference to 'i' is not a constant expression}}
>>    int &j = i;
>>
>>  #pragma omp target
>>
>> Modified: cfe/trunk/test/OpenMP/distribute_simd_aligned_messages.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/distribute_simd_aligned_messages.cpp?rev=305239&r1=305238&r2=305239&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/test/OpenMP/distribute_simd_aligned_messages.cpp (original)
>> +++ cfe/trunk/test/OpenMP/distribute_simd_aligned_messages.cpp Mon Jun 12
>> 16:59:18 2017
>> @@ -134,8 +134,9 @@ S3 h; // expected-note 2 {{'h' defined h
>>  template<class I, class C> int foomain(I argc, C **argv) {
>>    I e(argc);
>>    I g(argc);
>> -  int i; // expected-note {{'i' defined here}}
>> -  // expected-note at +1 {{declared here}}
>> +  int i; // expected-note {{declared here}} expected-note {{'i' defined
>> here}}
>> +  // expected-note at +2 {{declared here}}
>> +  // expected-note at +1 {{reference to 'i' is not a constant expression}}
>>    int &j = i;
>>
>>  #pragma omp target
>>
>> Modified: cfe/trunk/test/OpenMP/for_simd_aligned_messages.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_simd_aligned_messages.cpp?rev=305239&r1=305238&r2=305239&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/test/OpenMP/for_simd_aligned_messages.cpp (original)
>> +++ cfe/trunk/test/OpenMP/for_simd_aligned_messages.cpp Mon Jun 12
>> 16:59:18 2017
>> @@ -107,8 +107,9 @@ S3 h; // expected-note 2 {{'h' defined h
>>  template<class I, class C> int foomain(I argc, C **argv) {
>>    I e(argc);
>>    I g(argc);
>> -  int i; // expected-note {{'i' defined here}}
>> -  // expected-note at +1 {{declared here}}
>> +  int i; // expected-note {{declared here}} expected-note {{'i' defined
>> here}}
>> +  // expected-note at +2 {{declared here}}
>> +  // expected-note at +1 {{reference to 'i' is not a constant expression}}
>>    int &j = i;
>>    #pragma omp for simd aligned // expected-error {{expected '(' after
>> 'aligned'}}
>>    for (I k = 0; k < argc; ++k) ++k;
>>
>> Modified: cfe/trunk/test/OpenMP/parallel_for_simd_aligned_messages.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_for_simd_aligned_messages.cpp?rev=305239&r1=305238&r2=305239&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/test/OpenMP/parallel_for_simd_aligned_messages.cpp
>> (original)
>> +++ cfe/trunk/test/OpenMP/parallel_for_simd_aligned_messages.cpp Mon Jun
>> 12 16:59:18 2017
>> @@ -107,8 +107,9 @@ S3 h; // expected-note 2 {{'h' defined h
>>  template<class I, class C> int foomain(I argc, C **argv) {
>>    I e(argc);
>>    I g(argc);
>> -  int i; // expected-note {{'i' defined here}}
>> -  // expected-note at +1 {{declared here}}
>> +  int i; // expected-note {{declared here}} expected-note {{'i' defined
>> here}}
>> +  // expected-note at +2 {{declared here}}
>> +  // expected-note at +1 {{reference to 'i' is not a constant expression}}
>>    int &j = i;
>>    #pragma omp parallel for simd aligned // expected-error {{expected '('
>> after 'aligned'}}
>>    for (I k = 0; k < argc; ++k) ++k;
>>
>> Modified: cfe/trunk/test/OpenMP/simd_aligned_messages.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/simd_aligned_messages.cpp?rev=305239&r1=305238&r2=305239&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/test/OpenMP/simd_aligned_messages.cpp (original)
>> +++ cfe/trunk/test/OpenMP/simd_aligned_messages.cpp Mon Jun 12 16:59:18
>> 2017
>> @@ -107,8 +107,9 @@ S3 h; // expected-note 2 {{'h' defined h
>>  template<class I, class C> int foomain(I argc, C **argv) {
>>    I e(argc);
>>    I g(argc);
>> -  int i; // expected-note {{'i' defined here}}
>> -  // expected-note at +1 {{declared here}}
>> +  int i; // expected-note {{declared here}} expected-note {{'i' defined
>> here}}
>> +  // expected-note at +2 {{declared here}}
>> +  // expected-note at +1 {{reference to 'i' is not a constant expression}}
>>    int &j = i;
>>    #pragma omp simd aligned // expected-error {{expected '(' after
>> 'aligned'}}
>>    for (I k = 0; k < argc; ++k) ++k;
>>
>> Modified:
>> cfe/trunk/test/OpenMP/target_parallel_for_simd_aligned_messages.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_parallel_for_simd_aligned_messages.cpp?rev=305239&r1=305238&r2=305239&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/test/OpenMP/target_parallel_for_simd_aligned_messages.cpp
>> (original)
>> +++ cfe/trunk/test/OpenMP/target_parallel_for_simd_aligned_messages.cpp
>> Mon Jun 12 16:59:18 2017
>> @@ -107,8 +107,9 @@ S3 h; // expected-note 2 {{'h' defined h
>>  template<class I, class C> int foomain(I argc, C **argv) {
>>    I e(argc);
>>    I g(argc);
>> -  int i; // expected-note {{'i' defined here}}
>> -  // expected-note at +1 {{declared here}}
>> +  int i; // expected-note {{declared here}} expected-note {{'i' defined
>> here}}
>> +  // expected-note at +2 {{declared here}}
>> +  // expected-note at +1 {{reference to 'i' is not a constant expression}}
>>    int &j = i;
>>    #pragma omp target parallel for simd aligned // expected-error
>> {{expected '(' after 'aligned'}}
>>    for (I k = 0; k < argc; ++k) ++k;
>>
>> Modified: cfe/trunk/test/OpenMP/target_simd_aligned_messages.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_simd_aligned_messages.cpp?rev=305239&r1=305238&r2=305239&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/test/OpenMP/target_simd_aligned_messages.cpp (original)
>> +++ cfe/trunk/test/OpenMP/target_simd_aligned_messages.cpp Mon Jun 12
>> 16:59:18 2017
>> @@ -107,8 +107,9 @@ S3 h; // expected-note 2 {{'h' defined h
>>  template<class I, class C> int foomain(I argc, C **argv) {
>>    I e(argc);
>>    I g(argc);
>> -  int i; // expected-note {{'i' defined here}}
>> -  // expected-note at +1 {{declared here}}
>> +  int i; // expected-note {{declared here}} expected-note {{'i' defined
>> here}}
>> +  // expected-note at +2 {{declared here}}
>> +  // expected-note at +1 {{reference to 'i' is not a constant expression}}
>>    int &j = i;
>>    #pragma omp target simd aligned // expected-error {{expected '(' after
>> 'aligned'}}
>>    for (I k = 0; k < argc; ++k) ++k;
>>
>> Modified:
>> cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_aligned_messages.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_aligned_messages.cpp?rev=305239&r1=305238&r2=305239&view=diff
>>
>> ==============================================================================
>> ---
>> cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_aligned_messages.cpp
>> (original)
>> +++
>> cfe/trunk/test/OpenMP/target_teams_distribute_parallel_for_simd_aligned_messages.cpp
>> Mon Jun 12 16:59:18 2017
>> @@ -110,8 +110,9 @@ S3 h; // expected-note 2 {{'h' defined h
>>  template<class I, class C> int foomain(I argc, C **argv) {
>>    I e(argc);
>>    I g(argc);
>> -  int i; // expected-note {{'i' defined here}}
>> -  // expected-note at +1 {{declared here}}
>> +  int i; // expected-note {{declared here}} expected-note {{'i' defined
>> here}}
>> +  // expected-note at +2 {{declared here}}
>> +  // expected-note at +1 {{reference to 'i' is not a constant expression}}
>>    int &j = i;
>>
>>  #pragma omp target teams distribute parallel for simd aligned //
>> expected-error {{expected '(' after 'aligned'}}
>>
>> Modified:
>> cfe/trunk/test/OpenMP/target_teams_distribute_simd_aligned_messages.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_distribute_simd_aligned_messages.cpp?rev=305239&r1=305238&r2=305239&view=diff
>>
>> ==============================================================================
>> ---
>> cfe/trunk/test/OpenMP/target_teams_distribute_simd_aligned_messages.cpp
>> (original)
>> +++
>> cfe/trunk/test/OpenMP/target_teams_distribute_simd_aligned_messages.cpp Mon
>> Jun 12 16:59:18 2017
>> @@ -110,8 +110,9 @@ S3 h; // expected-note 2 {{'h' defined h
>>  template<class I, class C> int foomain(I argc, C **argv) {
>>    I e(argc);
>>    I g(argc);
>> -  int i; // expected-note {{'i' defined here}}
>> -  // expected-note at +1 {{declared here}}
>> +  int i; // expected-note {{declared here}} expected-note {{'i' defined
>> here}}
>> +  // expected-note at +2 {{declared here}}
>> +  // expected-note at +1 {{reference to 'i' is not a constant expression}}
>>    int &j = i;
>>
>>  #pragma omp target teams distribute simd aligned // expected-error
>> {{expected '(' after 'aligned'}}
>>
>> Modified: cfe/trunk/test/OpenMP/taskloop_simd_aligned_messages.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_simd_aligned_messages.cpp?rev=305239&r1=305238&r2=305239&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/test/OpenMP/taskloop_simd_aligned_messages.cpp (original)
>> +++ cfe/trunk/test/OpenMP/taskloop_simd_aligned_messages.cpp Mon Jun 12
>> 16:59:18 2017
>> @@ -107,8 +107,9 @@ S3 h; // expected-note 2 {{'h' defined h
>>  template<class I, class C> int foomain(I argc, C **argv) {
>>    I e(argc);
>>    I g(argc);
>> -  int i; // expected-note {{'i' defined here}}
>> -  // expected-note at +1 {{declared here}}
>> +  int i; // expected-note {{declared here}} expected-note {{'i' defined
>> here}}
>> +  // expected-note at +2 {{declared here}}
>> +  // expected-note at +1 {{reference to 'i' is not a constant expression}}
>>    int &j = i;
>>    #pragma omp taskloop simd aligned // expected-error {{expected '('
>> after 'aligned'}}
>>    for (I k = 0; k < argc; ++k) ++k;
>>
>> Modified:
>> cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_aligned_messages.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_aligned_messages.cpp?rev=305239&r1=305238&r2=305239&view=diff
>>
>> ==============================================================================
>> ---
>> cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_aligned_messages.cpp
>> (original)
>> +++
>> cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_aligned_messages.cpp
>> Mon Jun 12 16:59:18 2017
>> @@ -123,8 +123,9 @@ S3 h; // expected-note 2 {{'h' defined h
>>  template<class I, class C> int foomain(I argc, C **argv) {
>>    I e(argc);
>>    I g(argc);
>> -  int i; // expected-note {{'i' defined here}}
>> -  // expected-note at +1 {{declared here}}
>> +  int i; // expected-note {{declared here}} expected-note {{'i' defined
>> here}}
>> +  // expected-note at +2 {{declared here}}
>> +  // expected-note at +1 {{reference to 'i' is not a constant expression}}
>>    int &j = i;
>>
>>  #pragma omp target
>>
>> Modified: cfe/trunk/test/OpenMP/teams_distribute_simd_aligned_messages.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_simd_aligned_messages.cpp?rev=305239&r1=305238&r2=305239&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/test/OpenMP/teams_distribute_simd_aligned_messages.cpp
>> (original)
>> +++ cfe/trunk/test/OpenMP/teams_distribute_simd_aligned_messages.cpp Mon
>> Jun 12 16:59:18 2017
>> @@ -123,8 +123,9 @@ S3 h; // expected-note 2 {{'h' defined h
>>  template<class I, class C> int foomain(I argc, C **argv) {
>>    I e(argc);
>>    I g(argc);
>> -  int i; // expected-note {{'i' defined here}}
>> -  // expected-note at +1 {{declared here}}
>> +  int i; // expected-note {{declared here}} expected-note {{'i' defined
>> here}}
>> +  // expected-note at +2 {{declared here}}
>> +  // expected-note at +1 {{reference to 'i' is not a constant expression}}
>>    int &j = i;
>>
>>  #pragma omp target
>>
>> Modified: cfe/trunk/test/Sema/integer-overflow.c
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/integer-overflow.c?rev=305239&r1=305238&r2=305239&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/test/Sema/integer-overflow.c (original)
>> +++ cfe/trunk/test/Sema/integer-overflow.c Mon Jun 12 16:59:18 2017
>> @@ -152,13 +152,7 @@ uint64_t check_integer_overflows(int i)
>>    uint64_t b2 = b[4608 * 1024 * 1024] + 1;
>>
>>  // expected-warning at +1 2{{overflow in expression; result is 536870912
>> with type 'int'}}
>> -  int j1 = i ? (4608 * 1024 * 1024) : (4608 * 1024 * 1024);
>> -
>> -// expected-warning at +1 {{overflow in expression; result is 536870912 with
>> type 'int'}}
>> -  int j2 = -(4608 * 1024 * 1024);
>> -
>> -// expected-warning at +1 {{overflow in expression; result is 536870912 with
>> type 'int'}}
>> -  uint64_t j3 = b[4608 * 1024 * 1024];
>> +  (void)((i ? (4608 * 1024 * 1024) : (4608 * 1024 * 1024)) + 1);
>>
>>  // expected-warning at +1 2{{overflow in expression; result is 536870912
>> with type 'int'}}
>>    return ((4608 * 1024 * 1024) + ((uint64_t)(4608 * 1024 * 1024)));
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>


More information about the cfe-commits mailing list