History

Add testcase __has_include and __has_include_next

herman ten brugge committed 4 years ago

Commit 0f72db01 parent 90b68cb2 files · +34 −0Browse files

Unified · Split

2 files
  1. tests/tests2/18_include.c +30 −0
  2. tests/tests2/18_include.expect +4 −0
tests/tests2/18_include.c+30−0
@@ -6,6 +6,36 @@ int main() · 5 unmodified lines
6#include "18_include.h"6#include "18_include.h"
7 printf("done\n");7 printf("done\n");
8 8
9#define INC "18_include.h"
10
11#ifdef __has_include
12#if defined __has_include
13#if __has_include("18_include.h")
14 printf("has_include\n");
15#endif
16#if __has_include(INC)
17 printf("has_include\n");
18#endif
19#if __has_include("not_found_18_include.h")
20 printf("has_include not found\n");
21#endif
22#endif
23#endif
24
25#ifdef __has_include_next
26#if defined __has_include_next
27#if __has_include_next("18_include.h")
28 printf("has_include_next\n");
29#endif
30#if __has_include_next(INC)
31 printf("has_include_next\n");
32#endif
33#if __has_include_next("not_found_18_include.h")
34 printf("has_include_next not found\n");
35#endif
36#endif
37#endif
38
9 return 0;39 return 0;
10}40}
11 41
tests/tests2/18_include.expect+4−0
@@ -1,3 +1,7 @@
1including1including
2included2included
3done3done
4has_include
5has_include
6has_include_next
7has_include_next

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t