aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/builtin-constant-p.c3
-rw-r--r--tests/builtin-constant-p.qbe2
2 files changed, 5 insertions, 0 deletions
diff --git a/tests/builtin-constant-p.c b/tests/builtin-constant-p.c
new file mode 100644
index 0000000..fa16ed3
--- /dev/null
+++ b/tests/builtin-constant-p.c
@@ -0,0 +1,3 @@
+int f(void);
+int x = __builtin_constant_p(1+2*3);
+int y = __builtin_constant_p(f());
diff --git a/tests/builtin-constant-p.qbe b/tests/builtin-constant-p.qbe
new file mode 100644
index 0000000..f92388f
--- /dev/null
+++ b/tests/builtin-constant-p.qbe
@@ -0,0 +1,2 @@
+export data $x = align 4 { w 1, }
+export data $y = align 4 { w 0, }