From 8e47cf45dfed44627fa6f73f8734f2149c661044 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Fri, 31 Jan 2020 13:41:04 -0800 Subject: eval: Allow casting address constants to integer types in constant expressions --- test/initializer-pointer-int-cast.c | 2 ++ test/initializer-pointer-int-cast.qbe | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 test/initializer-pointer-int-cast.c create mode 100644 test/initializer-pointer-int-cast.qbe (limited to 'test') diff --git a/test/initializer-pointer-int-cast.c b/test/initializer-pointer-int-cast.c new file mode 100644 index 0000000..75963b2 --- /dev/null +++ b/test/initializer-pointer-int-cast.c @@ -0,0 +1,2 @@ +int x; +long p = (long)&x; diff --git a/test/initializer-pointer-int-cast.qbe b/test/initializer-pointer-int-cast.qbe new file mode 100644 index 0000000..a996882 --- /dev/null +++ b/test/initializer-pointer-int-cast.qbe @@ -0,0 +1,2 @@ +export data $p = align 8 { l $x, } +export data $x = align 4 { z 4 } -- cgit v1.2.3