1 // RUN: %clang_cc1 -std=c90 -fconst-strings -DCONST_STRINGS -verify %s
2 // RUN: %clang_cc1 -std=c90 -verify %s
4 // expected-no-diagnostics
6 #define IsEqual(L, R) (__builtin_strcmp(L, R) == 0)
8 const char *const FILE = __builtin_FILE();
9 const char *const FUNC
= __builtin_FUNCTION();
10 const unsigned LINE
= __builtin_LINE();
11 const unsigned COL
= __builtin_COLUMN();
14 char *const NCFILE
= __builtin_FILE();
15 char *const NCFUNC
= __builtin_FUNCTION();
19 _Static_assert(IsEqual(__builtin_FILE(), __FILE__
), "");
20 _Static_assert(__builtin_LINE() == __LINE__
, "");
21 _Static_assert(IsEqual("", __builtin_FUNCTION()), "");
24 _Static_assert(__builtin_LINE() == 42, "");
25 _Static_assert(IsEqual(__builtin_FILE(), "my_file.c"), "");
27 _Static_assert(__builtin_COLUMN() == __builtin_strlen("_Static_assert(_"), "");
30 _Static_assert(IsEqual(__builtin_FUNCTION(), "foo"), "");
32 #endif // CONST_STRINGS