It's still possible that the wrong value is returned from the alias
of variable even if the program can be compiled without issue. This
improves the check by executing the binary to check the result.
If alias attribute can't be working properly, the @target_page in
exec-vary.c will always return zeroes when we have the following gcc
version.
# gcc --version
gcc (GCC) 11.0.0 20210210 (Red Hat 11.0.0-0)
This abstracts the code from exec-vary.c and use it as indicator to
enable gcc alias attribute or not.
+void write_x(int val);
+
+void write_x(int val)
+{
+ x = val;
+}
+
+int main(void)
+{
+ return read_y();
+}