From 6fc2cd9f615b32e9ec2472d00f06d5ccabe8292f Mon Sep 17 00:00:00 2001 From: mrdudz Date: Sat, 17 Sep 2022 14:42:18 +0200 Subject: [PATCH] add test related to bug #1853 --- test/val/bug1853-inline-asm.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/val/bug1853-inline-asm.c diff --git a/test/val/bug1853-inline-asm.c b/test/val/bug1853-inline-asm.c new file mode 100644 index 000000000..9813566dc --- /dev/null +++ b/test/val/bug1853-inline-asm.c @@ -0,0 +1,21 @@ + +/* #1853 - Regression on inline assembly expression evaluation */ + +int main(void) +{ +/* +compiles with e.g. Git 2f4e2a3 to the expected + + lda 1 + lda 1 + 1 + rts + +However, with the current HEAD, it compiles to + + lda 1 + lda +*/ + __asm__("lda 1"); + __asm__("lda 1 + 1"); + return 0; +}