/*
 * logical_and.stp
 *
 * Check that systemtap "logical and" works
 */

global x1_0
global x2_1
global x3_0
global x4_1

probe begin
{
	println("systemtap starting probe")
	x1_0 = 0; x2_1 = 1; x3_0 = 0; x4_1 = 1;
}

probe end
{
	rc = 0
	println("systemtap ending probe")
	if (x1_0 && x3_0 ) {
		println("systemtap test failure");
	} else {
		rc += 1
	}
	if (x2_1 && x3_0 ) {
		println("systemtap test failure");
	} else {
		rc += 1
	}
	if (x1_0 && x4_1 ) {
		println("systemtap test failure");
	} else {
		rc += 1
	}
	if (x2_1 && x4_1 ) {
		rc += 1
	} else {
		println("systemtap test failure");
	}

	if (rc == 4)
		println("systemtap test success")
	else
		printf("systemtap test failure (%d passes)\n", rc)
}
