aboutsummaryrefslogtreecommitdiff
path: root/tinycc/tests/tests2/93_integer_promotion.c
diff options
context:
space:
mode:
authorUneven Prankster <unevenprankster@protonmail.com>2023-07-17 01:34:34 -0300
committerUneven Prankster <unevenprankster@protonmail.com>2023-07-17 01:34:34 -0300
commit88d82c6eaee88398af1de57cddca692a1f74b087 (patch)
treedf492c2002a1820959703f4f481172cceafeb0a1 /tinycc/tests/tests2/93_integer_promotion.c
parent111c133b939c15c57c90cd474d55e84928c6307a (diff)
Cleanup feels good! Big work coming up this week.
Diffstat (limited to 'tinycc/tests/tests2/93_integer_promotion.c')
-rw-r--r--tinycc/tests/tests2/93_integer_promotion.c71
1 files changed, 0 insertions, 71 deletions
diff --git a/tinycc/tests/tests2/93_integer_promotion.c b/tinycc/tests/tests2/93_integer_promotion.c
deleted file mode 100644
index a1176fc..0000000
--- a/tinycc/tests/tests2/93_integer_promotion.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/* integer promotion */
-
-int printf(const char*, ...);
-#define promote(s) printf(" %ssigned : %s\n", (s) - 100 < 0 ? " " : "un", #s);
-
-int main (void)
-{
- struct {
- unsigned ub:3;
- unsigned u:32;
- unsigned long long ullb:35;
- unsigned long long ull:64;
- unsigned char c;
- } s = { 1, 1, 1 };
-
- promote(s.ub);
- promote(s.u);
- promote(s.ullb);
- promote(s.ull);
- promote(s.c);
- printf("\n");
-
- promote((1 ? s.ub : 1));
- promote((1 ? s.u : 1));
- promote((1 ? s.ullb : 1));
- promote((1 ? s.ull : 1));
- promote((1 ? s.c : 1));
- printf("\n");
-
- promote(s.ub << 1);
- promote(s.u << 1);
- promote(s.ullb << 1);
- promote(s.ull << 1);
- promote(s.c << 1);
- printf("\n");
-
- promote(+s.ub);
- promote(+s.u);
- promote(+s.ullb);
- promote(+s.ull);
- promote(+s.c);
- printf("\n");
-
- promote(-s.ub);
- promote(-s.u);
- promote(-s.ullb);
- promote(-s.ull);
- promote(-s.c);
- printf("\n");
-
- promote(~s.ub);
- promote(~s.u);
- promote(~s.ullb);
- promote(~s.ull);
- promote(~s.c);
- printf("\n");
-
- promote(!s.ub);
- promote(!s.u);
- promote(!s.ullb);
- promote(!s.ull);
- promote(!s.c);
- printf("\n");
-
- promote(+(unsigned)s.ub);
- promote(-(unsigned)s.ub);
- promote(~(unsigned)s.ub);
- promote(!(unsigned)s.ub);
-
- return 0;
-}