@@ -16,4 +16,5 @@ int foo(int **g, int j)
* check-known-to-fail
* check-output-ignore
* check-output-excludes: ret\\..* \\$1
+ * check-output-contains: ret\\..* \\$0
*/
new file mode 100644
@@ -0,0 +1,18 @@
+struct s {
+ int c;
+ char a[];
+} s;
+
+char foo(int *ptr, long i)
+{
+ return s.a[i];
+}
+
+/*
+ * check-name: symaddr-op
+ * check-command: test-linearize -m64 -Wno-decl $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-excludes: add.64 .* <- s,
+ */
new file mode 100644
@@ -0,0 +1,32 @@
+int g;
+int a[3];
+int b[3];
+
+void usep(int*);
+
+int foo(void)
+{
+ int r = 0;
+ usep(&g);
+ usep(a);
+ usep(b + 1);
+ return r;
+}
+
+/*
+ * check-name: symaddr
+ * check-command: test-linearize -Wno-decl $file
+ *
+ * check-output-start
+foo:
+.L0:
+ <entry-point>
+ call usep, g
+ call usep, a
+ add.64 %r4 <- b, $4
+ call usep, %r4
+ ret.32 $0
+
+
+ * check-output-end
+ */
Add a few testcases showing problems introduced with the removal of OP_SYMADDRs. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- validation/mem2reg/address-used00.c | 1 + validation/symaddr-op.c | 18 ++++++++++++++++++ validation/symaddr.c | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 validation/symaddr-op.c create mode 100644 validation/symaddr.c