aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-2.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-2.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-2.c
new file mode 100644
index 000000000..745fed9d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-2.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-options "" } */
+#include <stdint.h>
+
+extern void abort (void);
+
+int main (void)
+{
+ uint32_t a = 4;
+ uint32_t b;
+
+ b = __builtin_bswap32 (a);
+ a = __builtin_bswap32 (b);
+
+ if (b == 4 || a != 4)
+ abort ();
+
+ return 0;
+}