2 * Copyright 2016, Chris Smart, IBM Corporation.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
9 * Calls to copy_first which are not 128-byte aligned should be
10 * caught and sent a SIGBUS.
17 #include "instructions.h"
18 #include "copy_paste_unaligned_common.h"
20 unsigned int expected_instruction = PPC_INST_COPY_FIRST;
21 unsigned int instruction_mask = 0xfc2007fe;
23 int test_copy_first_unaligned(void)
25 /* Only run this test on a P9 or later */
26 SKIP_IF(!have_hwcap2(PPC_FEATURE2_ARCH_3_00));
28 /* Register our signal handler with SIGBUS */
29 setup_signal_handler();
31 /* +1 makes buf unaligned */
32 copy_first(cacheline_buf+1);
34 /* We should not get here */
38 int main(int argc, char *argv[])
40 return test_harness(test_copy_first_unaligned, "test_copy_first_unaligned");