From a04808f22f9c14d258bdb7d4353492ff094a7413 Mon Sep 17 00:00:00 2001 From: Christopher Li Date: Thu, 17 Jun 2010 17:19:01 -0700 Subject: Adding asm goto label test case Provided by Jiri Slaby Signed-off-by: Christopher Li --- validation/asm-goto-lables.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 validation/asm-goto-lables.c diff --git a/validation/asm-goto-lables.c b/validation/asm-goto-lables.c new file mode 100644 index 0000000..ac2bf2a --- /dev/null +++ b/validation/asm-goto-lables.c @@ -0,0 +1,22 @@ +static inline int __static_cpu_has(unsigned char bit) +{ + asm goto("1: jmp %l[t_no]\n" + "2:\n" + ".section .altinstructions,\"a\"\n" + "\n" + "1b\n" + "0\n" /* no replacement */ + " .byte %P0\n" /* feature bit */ + " .byte 2b - 1b\n" /* source len */ + " .byte 0\n" /* replacement len */ + " .byte 0xff + 0 - (2b-1b)\n" /* padding */ + ".previous\n" + : : "i" (bit) : : t_no, ble); + return 1; +t_no: + return 0; +} +/* + * check-name: Asm with goto labels. + */ + -- cgit v1.2.3-65-gdbad