]> pd.if.org Git - lice/blob - tests/returnaddr.c
autocommit for files dated 2014-11-17 20:13:36
[lice] / tests / returnaddr.c
1 // __builtin_return_address
2
3 static void *a(void) {
4     return __builtin_return_address(1);
5 }
6
7 static void *b(void) {
8     expecti(__builtin_return_address(0), a());
9     return __builtin_return_address(0);
10 }
11
12 static void *c(void) {
13 _1:
14     void *this = b();
15 _2:
16     expecti((&&_1 < this && this <= &&_2), 1);
17
18     return this;
19 }
20
21 int main(void) {
22     expecti(c() <= b(), 1);
23
24     return 0;
25 }