OpenTTD Source: src/tests/enum_over_optimisation.cpp File Reference

OpenTTD Source 15.3

Enumerations | Functions
enum_over_optimisation.cpp File Reference

Test whether we do not trigger an over optimisation of enums. More...

`#include "../stdafx.h"`
`#include "../core/enum_type.hpp"`
`#include "../3rdparty/catch2/catch.hpp"`
`#include "../safeguards.h"`

Go to the source code of this file.

## Enumerations
enum | TestEnum : int8_t { ZERO , ONE , TWO }
enum class | TestEnumFlags : uint8_t { Zero = 0 , One = 1 << 0 , Two = 1 << 1 }

## Functions
| TEST_CASE ("EnumOverOptimisation_BoundsCheck")
| TEST_CASE ("EnumOverOptimisation_Bitmask")

## Detailed Description

Test whether we do not trigger an over optimisation of enums.

For more details, see http://gcc.gnu.org/PR43680 and PR#5246.

Definition in file enum_over_optimisation.cpp.

## Enumeration Type Documentation

## ◆ TestEnum

enum TestEnum : int8_t

Definition at line 22 of file enum_over_optimisation.cpp.

## ◆ TestEnumFlags

enum class TestEnumFlags : uint8_t
| strong

Definition at line 37 of file enum_over_optimisation.cpp.

## Function Documentation

## ◆ TEST_CASE() [1/2]

TEST_CASE | ( | "EnumOverOptimisation_Bitmask" |  | ) |

Definition at line 44 of file enum_over_optimisation.cpp.

## ◆ TEST_CASE() [2/2]

TEST_CASE | ( | "EnumOverOptimisation_BoundsCheck" |  | ) |

Definition at line 28 of file enum_over_optimisation.cpp.