代码搜索结果
找到约 10,000 项符合
Switch 的代码
case-range1.c
// { dg-do compile }
// Tests if case ranges (a GNU extension) are accepted
// { dg-options "" }
const int low = -2;
const int high = 15;
template
T f2 (T i)
{
switch (i)
{
case
case-range2.c
// { dg-do compile }
// Tests if case ranges (a GNU extension) correctly emit messages
// about overlapping ranges.
// { dg-options "" }
const int low = -2;
const int high = 15;
template
jump.c
// { dg-do assemble }
// PRMS Id: 6036
extern int a;
int main() {
switch (a) {
case 1:
int v2 = 3; // { dg-error "" } referenced below
case 2: // { dg-error "" } jumping past initiali
20011223-1.c
/* Origin: Joseph Myers . */
/* Case labels in a switch statement are converted to the promoted
type of the controlling expression, not an unpromoted version.
Reported as PR c/
990524-1.c
char a[] = "12345";
char b[] = "12345";
void loop (char * pz, char * pzDta)
{
for (;;) {
switch (*(pz++) = *(pzDta++)) {
case 0:
goto loopDone2;
case '"':
case '\\':
pr14730.c
/* PR middle-end/14730 */
int t (char i)
{
switch (i)
{
case 1:
case 7:
case 10:
case 14:
case 9:
case 256:
return 0;
}
return 1;
}
20041207.c
/* PR18867 - ICE on a switch controlling expressions with an
invalid type. Origin: Serge Belyshev */
void f()
{
float x;
switch (x) {case 0: break;}; /* { dg-error
7c-01.c
/* { dg-do compile } */
#include
vector float
f(int i)
{
switch (i) {
case 0:
return (vector float)(((vector unsigned char){3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}));
}
return ((vecto
wswitch.c
/* PR c/4475, PR c++/3780 */
/* { dg-do compile } */
/* { dg-options "-Wswitch" } */
enum e { e1, e2 };
int
foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el,
enum e em, enum e en,
wswitch-2.c
/* Further -Wswitch tests. */
/* { dg-do compile } */
/* { dg-options "-Wswitch" } */
enum e { e1 = 0, e2 = 1, e3 = 1, e4 = 2 };
int
foo (enum e ei, int j)
{
switch (ei)
{
case e1: return