OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [initlist-opt.C] - Rev 301

Compare with Previous | Blame | View Log

// PR c++/41997
// { dg-options "-std=c++0x -O2 -fdump-tree-optimized" }
// { dg-final { scan-tree-dump-not "_0" "optimized" } }
// { dg-final { cleanup-tree-dump "optimized" } }

#include <initializer_list>

inline int max_val(std::initializer_list<int> il)
{
        int i = *(il.begin());
        int j = *(il.begin() + 1);
        return (i > j ? i : j);
}

int main(void)
{
        return max_val({1,2});
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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