ae2f_docs
Loading...
Searching...
No Matches
builtins.c
1#include <ae2f/cc.h>
2#include <assert.h>
3#include <stdlib.h>
4#include <stdio.h>
5
6const int GLOBAL_THREE = 3;
7
8ae2f_inline static int ae2f_ccpure ae2f_noexcept RETURN_THREE(void) {
9 return GLOBAL_THREE;
10}
11
12int ae2f_ccconst ae2f_noexcept I_ADD(const int, const int);
13
14int ae2f_ccconst ae2f_noexcept I_ADD(const int a, const int b) {
15 return a + b;
16}
17
18int main(void) {
19 void* ae2f_restrict HELLO;
20
21 assert(I_ADD(3, 4) == 7);
22 { ae2f_assume(RETURN_THREE()); }
23
24 HELLO = malloc(3);
25 assert(HELLO);
26 { ae2f_assume(HELLO); }
27 free(HELLO);
28
29 if(ae2f_expected(RETURN_THREE())) {
30 puts("Hello World!");
31 }
32
33 if(ae2f_expected_not(I_ADD(3, -3))) {
35 puts("hi");
36 }
37
38 return 0;
39}
#define ae2f_assume(a)
tells the compiler that value if a is false, below this keyword is not expected to be reached.
Definition cc.h:228
#define ae2f_ccpure
Keyword as [[pure]] on C23.
Definition cc.h:52
#define ae2f_ccconst
Keyword as [[const]] on C23..
Definition cc.h:66
#define ae2f_noexcept
marker that this function does not throw something.
Definition cc.h:133
#define ae2f_restrict
Keyword as restrict on C99.
Definition cc.h:81
#define ae2f_expected_not(a)
expectes a as false.
Definition cc.h:185
#define ae2f_unreachable()
tells the compiler that below this keyword is not expected to be reached.
Definition cc.h:213
#define ae2f_inline
inline
Definition cc.h:149
#define ae2f_expected(a)
expectes a as true.
Definition cc.h:184