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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [nullptr11.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
// { dg-do compile }
2
// { dg-options "-std=c++0x" }
3
 
4
// Test relational operators
5
 
6
#define assert_true(b) do { char c[2 * bool(b) - 1]; } while(0)
7
#define assert_false(b) do { char c[1 - 2 * bool(b)]; } while(0)
8
 
9
void fun()
10
{
11
  assert_true(nullptr == nullptr);
12
  assert_false(nullptr != nullptr);
13
  assert_false(nullptr < nullptr);
14
  assert_false(nullptr > nullptr);
15
  assert_true(nullptr <= nullptr);
16
  assert_true(nullptr >= nullptr);
17
 
18
  decltype(nullptr) mynull = 0;
19
 
20
  assert_true(mynull == nullptr);
21
  assert_false(mynull != nullptr);
22
  assert_false(mynull < nullptr);
23
  assert_false(mynull > nullptr);
24
  assert_true(mynull <= nullptr);
25
  assert_true(mynull >= nullptr);
26
 
27
  assert_true(nullptr == mynull);
28
  assert_false(nullptr != mynull);
29
  assert_false(nullptr < mynull);
30
  assert_false(nullptr > mynull);
31
  assert_true(nullptr <= mynull);
32
  assert_true(nullptr >= mynull);
33
 
34
  assert_true(mynull == mynull);
35
  assert_false(mynull != mynull);
36
  assert_false(mynull < mynull);
37
  assert_false(mynull > mynull);
38
  assert_true(mynull <= mynull);
39
  assert_true(mynull >= mynull);
40
}

powered by: WebSVN 2.1.0

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