diff options
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Sema/switch.c | 12 | 
1 files changed, 11 insertions, 1 deletions
| diff --git a/clang/test/Sema/switch.c b/clang/test/Sema/switch.c index 092378d48bc..7aa695d7cb9 100644 --- a/clang/test/Sema/switch.c +++ b/clang/test/Sema/switch.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify -Wswitch-enum -Wcovered-switch-default %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wswitch-enum -Wcovered-switch-default -triple x86_64-linux-gnu %s  void f (int z) {     while (z) {       default: z--;            // expected-error {{statement not in switch}} @@ -375,3 +375,13 @@ void switch_on_ExtendedEnum1(enum ExtendedEnum1 e) {    }  } +void PR11778(char c, int n, long long ll) { +  // Do not reject this; we don't have duplicate case values because we +  // check for duplicates in the promoted type. +  switch (c) case 1: case 257: ; // expected-warning {{overflow}} + +  switch (n) case 0x100000001LL: case 1: ; // expected-warning {{overflow}} expected-error {{duplicate}} expected-note {{previous}} +  switch ((int)ll) case 0x100000001LL: case 1: ; // expected-warning {{overflow}} expected-error {{duplicate}} expected-note {{previous}} +  switch ((long long)n) case 0x100000001LL: case 1: ; +  switch (ll) case 0x100000001LL: case 1: ; +} | 

