39 lines
649 B
C++
39 lines
649 B
C++
#include <cstdint>
|
|
#include <unistd.h>
|
|
#include <string>
|
|
|
|
uint32_t my_glob = 42;
|
|
|
|
namespace test {
|
|
enum MyEnum : uint16_t {
|
|
ENUM_VAL1 = 10,
|
|
ENUM_VAL2 = 5,
|
|
ENUM_VAL3 = 0xFFF,
|
|
};
|
|
|
|
struct MyType {
|
|
int data;
|
|
uint32_t test_bits : 20;
|
|
uint32_t test_bits2: 12;
|
|
MyEnum enum_val;
|
|
std::string* ptr = nullptr;
|
|
};
|
|
}
|
|
|
|
void helper_fn() {
|
|
test::MyType tmp = test::MyType{1, 22, 4000};
|
|
std::string test = "Hello World";
|
|
uint32_t x = 25;
|
|
unsigned int y = 30;
|
|
sleep(tmp.data);
|
|
{
|
|
test::MyType tmp = test::MyType{.data = 2, .ptr = &test};
|
|
sleep(tmp.data);
|
|
}
|
|
}
|
|
|
|
void helper_fn2() {
|
|
test::MyType tmp = test::MyType{3};
|
|
sleep(tmp.data);
|
|
}
|