diff --git a/tests/syntax/cast-struct-function-attr.i b/tests/syntax/cast-struct-function-attr.i
new file mode 100644
index 0000000000000000000000000000000000000000..778b8ccd6cc2a6ed0b9c339dd6406cbc48c93226
--- /dev/null
+++ b/tests/syntax/cast-struct-function-attr.i
@@ -0,0 +1,8 @@
+struct t {
+  int a;
+};
+typedef struct t t;
+__attribute__((visibility("hidden"))) t f() {
+  t res = {0};
+  return res;
+}