gcc/testsuite/g++.dg/modules/builtin-3_a.C
raw| 1 | // { dg-additional-options -fmodules-ts } |
| 2 | module; |
| 3 | #include <stdarg.h> |
| 4 | export module builtins; |
| 5 | // { dg-module-cmi builtins } |
| 6 | |
| 7 | export inline unsigned length (char const *ptr) |
| 8 | { |
| 9 | return __builtin_strlen (ptr); |
| 10 | } |
| 11 | |
| 12 | export inline int count (int a, ...) |
| 13 | { |
| 14 | int c = 0; |
| 15 | |
| 16 | va_list args; |
| 17 | va_start (args, a); |
| 18 | while (va_arg (args, char *)) |
| 19 | c++; |
| 20 | va_end (args); |
| 21 | |
| 22 | return c; |
| 23 | } |