xref: /openbmc/qemu/tests/tcg/hexagon/invalid-slots.c (revision 2f95279a)
1 /*
2  *  Copyright(c) 2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 char mem[8] __attribute__((aligned(8)));
19 
20 int main()
21 {
22     asm volatile(
23         "r0 = #mem\n"
24         /* Invalid packet (2 instructions at slot 0): */
25         ".word 0xa1804100\n" /* { memw(r0) = r1;      */
26         ".word 0x28032804\n" /*   r3 = #0; r4 = #0 }  */
27         : : : "r0", "r3", "r4", "memory");
28     return 0;
29 }
30