cmake: Add -Werror=attribute-optimize when testing compiler support

Older clang versions appear to use this flag to control handling of
messages related to __optimize__ attribute values.

Signed-off-by: Keith Packard <[email protected]>
diff --git a/cmake/picolibc.cmake b/cmake/picolibc.cmake
index 09cc84e..303772d 100644
--- a/cmake/picolibc.cmake
+++ b/cmake/picolibc.cmake
@@ -126,6 +126,7 @@
   -Werror=attributes
   -Werror=unsupported-floating-point-opt
   -Werror=ignored-optimization-argument
+  -Werror=attribute-optimize
   -Wno-unused-command-line-argument
   )