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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [ext/] [builtin10.C] - Blame information for rev 801

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile { target correct_iso_cpp_string_wchar_protos } }
2
// { dg-options "-O2 -fdump-tree-optimized" }
3
 
4
#include 
5
 
6
const void *cv1;
7
const char *cc1, *cc2, *cc3, *cc4;
8
void *v1;
9
char *c1, *c2, *c3, *c4;
10
 
11
void
12
f1 (void)
13
{
14
  cv1 = memchr ("abcba", 'b', 3);
15
  cc1 = strchr ("abcba", 'b');
16
  cc2 = strrchr ("abcba", 'b');
17
  cc3 = strpbrk ("dabc", "abc");
18
  cc4 = strstr ("aaabc", "abc");
19
}
20
 
21
void
22
f2 (void)
23
{
24
  cv1 = std::memchr ("abcba", 'b', 3);
25
  cc1 = std::strchr ("abcba", 'b');
26
  cc2 = std::strrchr ("abcba", 'b');
27
  cc3 = std::strpbrk ("dabc", "abc");
28
  cc4 = std::strstr ("aaabc", "abc");
29
}
30
 
31
void
32
f3 (void)
33
{
34
  v1 = memchr ((char *)"abcba", 'b', 3);
35
  c1 = strchr ((char *)"abcba", 'b');
36
  c2 = strrchr ((char *)"abcba", 'b');
37
  c3 = strpbrk ((char *)"dabc", "abc");
38
  c4 = strstr ((char *)"aaabc", "abc");
39
}
40
 
41
void
42
f4 (void)
43
{
44
  v1 = std::memchr ((char *)"abcba", 'b', 3);
45
  c1 = std::strchr ((char *)"abcba", 'b');
46
  c2 = std::strrchr ((char *)"abcba", 'b');
47
  c3 = std::strpbrk ((char *)"dabc", "abc");
48
  c4 = std::strstr ((char *)"aaabc", "abc");
49
}
50
 
51
// { dg-final { scan-tree-dump-not "memchr" "optimized" } }
52
// { dg-final { scan-tree-dump-not "strchr" "optimized" } }
53
// { dg-final { scan-tree-dump-not "strrchr" "optimized" } }
54
// { dg-final { scan-tree-dump-not "strpbrk" "optimized" } }
55
// { dg-final { scan-tree-dump-not "strstr" "optimized" } }
56
// { dg-final { cleanup-tree-dump "optimized" } }

powered by: WebSVN 2.1.0

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