summaryrefslogtreecommitdiffstats
path: root/test/Sema/PR2963-enum-constant.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/PR2963-enum-constant.c')
-rw-r--r--test/Sema/PR2963-enum-constant.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Sema/PR2963-enum-constant.c b/test/Sema/PR2963-enum-constant.c
new file mode 100644
index 0000000..78f2326
--- /dev/null
+++ b/test/Sema/PR2963-enum-constant.c
@@ -0,0 +1,17 @@
+// RUN: clang-cc %s -verify -pedantic -fsyntax-only
+
+typedef short short_fixed;
+
+enum
+{
+ // 8.8 short_fixed
+ SHORT_FIXED_FRACTIONAL_BITS= 8,
+ SHORT_FIXED_ONE= 1<<SHORT_FIXED_FRACTIONAL_BITS
+};
+
+#define FLOAT_TO_SHORT_FIXED(f) ((short_fixed)((f)*SHORT_FIXED_ONE))
+
+enum
+{
+ SOME_VALUE= FLOAT_TO_SHORT_FIXED(0.1) // expected-warning{{expression is not integer constant expression}}
+};
OpenPOWER on IntegriCloud