and_0(int a)11f5207b7SJohn Levon int and_0(int a)
21f5207b7SJohn Levon {
31f5207b7SJohn Levon 	return a && 0;
41f5207b7SJohn Levon }
51f5207b7SJohn Levon 
and_1(int a)61f5207b7SJohn Levon int and_1(int a)
71f5207b7SJohn Levon {
81f5207b7SJohn Levon 	return a && 1;
91f5207b7SJohn Levon }
101f5207b7SJohn Levon 
or_0(int a)111f5207b7SJohn Levon int or_0(int a)
121f5207b7SJohn Levon {
131f5207b7SJohn Levon 	return a || 0;
141f5207b7SJohn Levon }
151f5207b7SJohn Levon 
or_1(int a)161f5207b7SJohn Levon int or_1(int a)
171f5207b7SJohn Levon {
181f5207b7SJohn Levon 	return a || 1;
191f5207b7SJohn Levon }
201f5207b7SJohn Levon 
21*c85f09ccSJohn Levon // try again but with something true but != 1
and_2(int a)22*c85f09ccSJohn Levon int and_2(int a)
23*c85f09ccSJohn Levon {
24*c85f09ccSJohn Levon 	return a && 2;
25*c85f09ccSJohn Levon }
26*c85f09ccSJohn Levon 
or_2(int a)27*c85f09ccSJohn Levon int or_2(int a)
28*c85f09ccSJohn Levon {
29*c85f09ccSJohn Levon 	return a || 2;
30*c85f09ccSJohn Levon }
31*c85f09ccSJohn Levon 
321f5207b7SJohn Levon /*
331f5207b7SJohn Levon  * check-name: bool-simplify
341f5207b7SJohn Levon  * check-command: test-linearize -Wno-decl $file
351f5207b7SJohn Levon  *
361f5207b7SJohn Levon  * check-output-start
371f5207b7SJohn Levon and_0:
381f5207b7SJohn Levon .L0:
391f5207b7SJohn Levon 	<entry-point>
401f5207b7SJohn Levon 	ret.32      $0
411f5207b7SJohn Levon 
421f5207b7SJohn Levon 
431f5207b7SJohn Levon and_1:
441f5207b7SJohn Levon .L2:
451f5207b7SJohn Levon 	<entry-point>
46*c85f09ccSJohn Levon 	setne.32    %r9 <- %arg1, $0
47*c85f09ccSJohn Levon 	ret.32      %r9
481f5207b7SJohn Levon 
491f5207b7SJohn Levon 
501f5207b7SJohn Levon or_0:
511f5207b7SJohn Levon .L4:
521f5207b7SJohn Levon 	<entry-point>
53*c85f09ccSJohn Levon 	setne.32    %r14 <- %arg1, $0
54*c85f09ccSJohn Levon 	ret.32      %r14
551f5207b7SJohn Levon 
561f5207b7SJohn Levon 
571f5207b7SJohn Levon or_1:
581f5207b7SJohn Levon .L6:
591f5207b7SJohn Levon 	<entry-point>
601f5207b7SJohn Levon 	ret.32      $1
611f5207b7SJohn Levon 
621f5207b7SJohn Levon 
63*c85f09ccSJohn Levon and_2:
64*c85f09ccSJohn Levon .L8:
65*c85f09ccSJohn Levon 	<entry-point>
66*c85f09ccSJohn Levon 	setne.32    %r25 <- %arg1, $0
67*c85f09ccSJohn Levon 	ret.32      %r25
68*c85f09ccSJohn Levon 
69*c85f09ccSJohn Levon 
70*c85f09ccSJohn Levon or_2:
71*c85f09ccSJohn Levon .L10:
72*c85f09ccSJohn Levon 	<entry-point>
73*c85f09ccSJohn Levon 	ret.32      $1
74*c85f09ccSJohn Levon 
75*c85f09ccSJohn Levon 
761f5207b7SJohn Levon  * check-output-end
771f5207b7SJohn Levon  */
78