1f08c3bdfSopenharmony_ciint flia(long a)
2f08c3bdfSopenharmony_ci{
3f08c3bdfSopenharmony_ci	return __builtin_expect(a, 1);
4f08c3bdfSopenharmony_ci}
5f08c3bdfSopenharmony_ci
6f08c3bdfSopenharmony_ciint flic(void)
7f08c3bdfSopenharmony_ci{
8f08c3bdfSopenharmony_ci	return __builtin_expect(1L << 32 | 1, 1);
9f08c3bdfSopenharmony_ci}
10f08c3bdfSopenharmony_ci
11f08c3bdfSopenharmony_cilong fila(int a)
12f08c3bdfSopenharmony_ci{
13f08c3bdfSopenharmony_ci	return __builtin_expect(a, 1);
14f08c3bdfSopenharmony_ci}
15f08c3bdfSopenharmony_ci
16f08c3bdfSopenharmony_cilong filc(void)
17f08c3bdfSopenharmony_ci{
18f08c3bdfSopenharmony_ci	return __builtin_expect(1L << 32 | 1, 1);
19f08c3bdfSopenharmony_ci}
20f08c3bdfSopenharmony_ci
21f08c3bdfSopenharmony_cilong filu(void)
22f08c3bdfSopenharmony_ci{
23f08c3bdfSopenharmony_ci	return __builtin_expect(0x80000000U, 1);
24f08c3bdfSopenharmony_ci}
25f08c3bdfSopenharmony_ci
26f08c3bdfSopenharmony_cilong fils(void)
27f08c3bdfSopenharmony_ci{
28f08c3bdfSopenharmony_ci	return __builtin_expect((int)0x80000000, 1);
29f08c3bdfSopenharmony_ci}
30f08c3bdfSopenharmony_ci
31f08c3bdfSopenharmony_civoid *fptr(void *a)
32f08c3bdfSopenharmony_ci{
33f08c3bdfSopenharmony_ci	return __builtin_expect(a, a);
34f08c3bdfSopenharmony_ci}
35f08c3bdfSopenharmony_ci
36f08c3bdfSopenharmony_ci/*
37f08c3bdfSopenharmony_ci * check-name: builtin-expect
38f08c3bdfSopenharmony_ci * check-command: test-linearize -m64 -Wno-decl $file
39f08c3bdfSopenharmony_ci * check-assert: sizeof(long) == 8
40f08c3bdfSopenharmony_ci *
41f08c3bdfSopenharmony_ci * check-output-start
42f08c3bdfSopenharmony_ciflia:
43f08c3bdfSopenharmony_ci.L0:
44f08c3bdfSopenharmony_ci	<entry-point>
45f08c3bdfSopenharmony_ci	trunc.32    %r2 <- (64) %arg1
46f08c3bdfSopenharmony_ci	ret.32      %r2
47f08c3bdfSopenharmony_ci
48f08c3bdfSopenharmony_ci
49f08c3bdfSopenharmony_ciflic:
50f08c3bdfSopenharmony_ci.L2:
51f08c3bdfSopenharmony_ci	<entry-point>
52f08c3bdfSopenharmony_ci	ret.32      $1
53f08c3bdfSopenharmony_ci
54f08c3bdfSopenharmony_ci
55f08c3bdfSopenharmony_cifila:
56f08c3bdfSopenharmony_ci.L4:
57f08c3bdfSopenharmony_ci	<entry-point>
58f08c3bdfSopenharmony_ci	sext.64     %r6 <- (32) %arg1
59f08c3bdfSopenharmony_ci	ret.64      %r6
60f08c3bdfSopenharmony_ci
61f08c3bdfSopenharmony_ci
62f08c3bdfSopenharmony_cifilc:
63f08c3bdfSopenharmony_ci.L6:
64f08c3bdfSopenharmony_ci	<entry-point>
65f08c3bdfSopenharmony_ci	ret.64      $0x100000001
66f08c3bdfSopenharmony_ci
67f08c3bdfSopenharmony_ci
68f08c3bdfSopenharmony_cifilu:
69f08c3bdfSopenharmony_ci.L8:
70f08c3bdfSopenharmony_ci	<entry-point>
71f08c3bdfSopenharmony_ci	ret.64      $0x80000000
72f08c3bdfSopenharmony_ci
73f08c3bdfSopenharmony_ci
74f08c3bdfSopenharmony_cifils:
75f08c3bdfSopenharmony_ci.L10:
76f08c3bdfSopenharmony_ci	<entry-point>
77f08c3bdfSopenharmony_ci	ret.64      $0xffffffff80000000
78f08c3bdfSopenharmony_ci
79f08c3bdfSopenharmony_ci
80f08c3bdfSopenharmony_cifptr:
81f08c3bdfSopenharmony_ci.L12:
82f08c3bdfSopenharmony_ci	<entry-point>
83f08c3bdfSopenharmony_ci	ret.64      %arg1
84f08c3bdfSopenharmony_ci
85f08c3bdfSopenharmony_ci
86f08c3bdfSopenharmony_ci * check-output-end
87f08c3bdfSopenharmony_ci *
88f08c3bdfSopenharmony_ci * check-error-start
89f08c3bdfSopenharmony_ciexpand/builtin-expect.c:33:33: warning: incorrect type in argument 1 (different base types)
90f08c3bdfSopenharmony_ciexpand/builtin-expect.c:33:33:    expected long
91f08c3bdfSopenharmony_ciexpand/builtin-expect.c:33:33:    got void *a
92f08c3bdfSopenharmony_ciexpand/builtin-expect.c:33:36: warning: incorrect type in argument 2 (different base types)
93f08c3bdfSopenharmony_ciexpand/builtin-expect.c:33:36:    expected long
94f08c3bdfSopenharmony_ciexpand/builtin-expect.c:33:36:    got void *a
95f08c3bdfSopenharmony_ciexpand/builtin-expect.c:33:32: warning: incorrect type in return expression (different base types)
96f08c3bdfSopenharmony_ciexpand/builtin-expect.c:33:32:    expected void *
97f08c3bdfSopenharmony_ciexpand/builtin-expect.c:33:32:    got long
98f08c3bdfSopenharmony_ciexpand/builtin-expect.c:8:42: warning: cast truncates bits from constant value (100000001 becomes 1)
99f08c3bdfSopenharmony_ci * check-error-end
100f08c3bdfSopenharmony_ci */
101