mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-12-22 07:30:54 +00:00
22 lines
430 B
C++
22 lines
430 B
C++
/* Conformance Test 8.7.0.4: Make sure enums are accepted in switch */
|
|
|
|
#include <stdio.h>
|
|
|
|
void main(void)
|
|
|
|
{
|
|
enum color {red, orange, yellow, green, blue, violet} c;
|
|
int primary = 0;
|
|
|
|
for (c = red; c <= violet; c++)
|
|
switch (c) {
|
|
case red: case yellow: case blue:
|
|
primary++;
|
|
}
|
|
|
|
if (primary == 3)
|
|
printf ("Passed Conformance Test 8.7.0.4\n");
|
|
else
|
|
printf ("Failed Conformance Test 8.7.0.4\n");
|
|
}
|