[hackers] [scc] Add test for ternary operator || sin

From: <git_AT_suckless.org>
Date: Fri, 14 Aug 2015 17:33:38 +0200 (CEST)

commit 287d81cca3ddb6386c8fb4712a46d7e7cb01e7bd
Author: sin <sin_AT_2f30.org>
AuthorDate: Fri Aug 14 16:26:20 2015 +0100
Commit: sin <sin_AT_2f30.org>
CommitDate: Fri Aug 14 16:32:33 2015 +0100

    Add test for ternary operator
    
    The test is currently failing.

diff --git a/cc1/tests/test003.c b/cc1/tests/test003.c
new file mode 100644
index 0000000..fdbc88b
--- /dev/null
+++ b/cc1/tests/test003.c
_AT_@ -0,0 +1,23 @@
+/*
+name: TEST003
+description: Select function to call inside ternary operator
+output:
+*/
+
+int
+foo(void)
+{
+ return 42;
+}
+
+int
+bar(void)
+{
+ return 24;
+}
+
+int
+main(void)
+{
+ return (1 ? foo : bar)();
+}
Received on Fri Aug 14 2015 - 17:33:38 CEST

This archive was generated by hypermail 2.3.0 : Fri Aug 14 2015 - 17:36:10 CEST