more tests

git-svn-id: svn+ssh://svn.cprover.org/srv/svn/cbmc/trunk@4973 6afb6bc1-c8e4-404c-8f48-9ae832c5b171
This commit is contained in:
kroening 2014-12-31 15:22:32 +00:00
parent 2084118c8d
commit e8a448bf94
1 changed files with 8 additions and 5 deletions

View File

@ -1,14 +1,17 @@
enum class Color : char { red, blue }; enum class Color1 : char { red, blue };
enum Color2 : char { red, blue };
// defaults to int // defaults to int
enum class TrafficLight { red, yellow, green }; enum class TrafficLight { red, yellow, green };
static_assert(sizeof(Color)==sizeof(char), "size of Color"); static_assert(sizeof(Color1)==sizeof(char), "size of Color1");
static_assert(sizeof(Color::red)==sizeof(char), "size of Color::red"); static_assert(sizeof(Color2)==sizeof(char), "size of Color2");
static_assert(sizeof(Color1::red)==sizeof(char), "size of Color1::red");
static_assert(sizeof(TrafficLight::red)==sizeof(int), "size of TrafficLight::red"); static_assert(sizeof(TrafficLight::red)==sizeof(int), "size of TrafficLight::red");
int main() int main()
{ {
Color c; Color1 c;
c=Color::red; c=Color1::red;
} }