111
|
1 // { dg-do run }
|
|
2
|
|
3 #include <cstring>
|
|
4
|
|
5 const char *gfile;
|
|
6 const char *gfn;
|
|
7 int gline;
|
|
8
|
|
9 void bar (const char *file = __builtin_FILE (),
|
|
10 const char *function = __builtin_FUNCTION (),
|
|
11 int line = __builtin_LINE ())
|
|
12 {
|
|
13 gfile = file;
|
|
14 gfn = function;
|
|
15 gline = line;
|
|
16 }
|
|
17
|
|
18 extern "C" void abort (void);
|
|
19
|
|
20 int main()
|
|
21 {
|
|
22 int here;
|
|
23 bar (); here = __LINE__;
|
|
24 if (std::strcmp (gfn, __FUNCTION__) != 0)
|
|
25 abort ();
|
|
26 if (std::strcmp (gfile, __FILE__) != 0)
|
|
27 abort ();
|
|
28 if (gline != here)
|
|
29 abort ();
|
|
30 return 0;
|
|
31 }
|