OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [udlit-embed-quote.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do run }
2
// { dg-options "-std=c++0x" }
3
 
4
//  Make sure embedded quotes are not a problem for string and char literals.
5
 
6
#include 
7
#include 
8
 
9
int operator"" _embedchar(char)
10
{ return 41; };
11
 
12
int operator"" _embedstr(const char*, std::size_t len)
13
{ return 42 + len; };
14
 
15
void
16
test()
17
{
18
  int i = '\''_embedchar;
19
 
20
  int j = "\""_embedstr;
21
  assert(j == 43);
22
 
23
  int k = "foo\""_embedstr;
24
  assert(k == 46);
25
 
26
  int l = "\"bar"_embedstr;
27
  assert(l == 46);
28
}
29
 
30
int
31
main()
32
{
33
  test();
34
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.