xref: /llvm-project/clang/test/Sema/shift-count-negative.c (revision de029943cc5ad0028f16e6ecaffa03e32ffd1a6f)
1 // RUN: %clang_cc1 -x c -fsyntax-only -verify=expected,c -pedantic %s
2 // RUN: %clang_cc1 -x c++ -fsyntax-only -verify=expected,cpp %s
3 
4 // RUN: %clang_cc1 -x c -fsyntax-only -verify=expected,c -pedantic %s -fexperimental-new-constant-interpreter
5 // RUN: %clang_cc1 -x c++ -fsyntax-only -verify=expected,cpp %s -fexperimental-new-constant-interpreter
6 
7 enum shiftof {
8     X = (1<<-29) // c-warning {{expression is not an integer constant expression; folding it to a constant is a GNU extension}}
9                  // cpp-error@-1 {{expression is not an integral constant expression}}
10                  // expected-note@-2 {{negative shift count -29}}
11 };
12