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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [constexpr-wstring1.C] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/48570
2
// { dg-do run }
3
// { dg-options "-std=c++0x" }
4
 
5
extern "C" void abort ();
6
constexpr wchar_t foo (int i) { return L"0123"[i]; }
7
constexpr char16_t bar (int i) { return u"0123"[i]; }
8
constexpr char32_t baz (int i) { return U"0123"[i]; }
9
const wchar_t foo0 = foo (0);
10
const wchar_t foo1 = foo (1);
11
const wchar_t foo2 = foo (2);
12
const wchar_t foo3 = foo (3);
13
const wchar_t foo4 = foo (4);
14
const char16_t bar0 = bar (0);
15
const char16_t bar1 = bar (1);
16
const char16_t bar2 = bar (2);
17
const char16_t bar3 = bar (3);
18
const char16_t bar4 = bar (4);
19
const char32_t baz0 = baz (0);
20
const char32_t baz1 = baz (1);
21
const char32_t baz2 = baz (2);
22
const char32_t baz3 = baz (3);
23
const char32_t baz4 = baz (4);
24
 
25
int
26
main ()
27
{
28
  if (foo0 != L'0' || foo1 != L'1' || foo2 != L'2' || foo3 != L'3' || foo4 != L'\0')
29
    abort ();
30
  if (bar0 != u'0' || bar1 != u'1' || bar2 != u'2' || bar3 != u'3' || bar4 != u'\0')
31
    abort ();
32
  if (baz0 != U'0' || baz1 != U'1' || baz2 != U'2' || baz3 != U'3' || baz4 != U'\0')
33
    abort ();
34
}

powered by: WebSVN 2.1.0

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