aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/pr101511.C
blob: ee2c7fdbc02e93bc5bae54fe4ccd6454e6181ad9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// { dg-do compile }
// { dg-options "-O2 -Wno-div-by-zero" }

void __assert_fail(const char *, const char *, int, const char *)
    __attribute__((__noreturn__));
template <typename T> void test_uint() {
  long __trans_tmp_3, __trans_tmp_1;
  int Error;
  for (;;) {
    {
      unsigned long Tmp = -1;
      __trans_tmp_3 = Tmp - Tmp % 0;
    }
    Error += 0 == __trans_tmp_3 ? 0 : 1;
    !Error ? void() : __assert_fail("", "", 3, __PRETTY_FUNCTION__);
    T Tmp = -1;
    __trans_tmp_1 = Tmp - Tmp % 0;
    Error += 0 == __trans_tmp_1 ? 0 : 1;
    !Error ? void() : __assert_fail("", "", 7, __PRETTY_FUNCTION__);
  }
}
void test() { test_uint<unsigned long>(); }