OSDN Git Service

PR c/10175
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / asm-names.c
1 /* The name specified by an asm("...") suffix on a declaration is not
2    to have an underscore prefixed, even if normal symbols are.
3    Problem reported by Krister Walfridsson <cato@df.lth.se>.  */
4
5 /* { dg-do link } */
6 /* { dg-options "-fleading-underscore" } */
7
8 extern void frobnicate (void) asm ("___frob14");  /* three underscores */
9
10 void __frob14 (void) {} /* two underscores */
11
12 int
13 main (void)
14 {
15   frobnicate ();
16   return 0;
17 }
18
19 /* In case built where the runtime expects no leading underscore on
20    main(). */
21 extern int xmain (void) asm ("main");
22
23 int xmain (void) { return main(); }
24
25 /* In case built where the runtime calls __main.  */
26 extern int ymain (void) asm ("___main");
27 int ymain (void) { return main(); }