aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/optim
diff options
Diffstat (limited to 'validation/optim')
-rw-r--r--validation/optim/bitfield-init-zero.c102
-rw-r--r--validation/optim/bitfield-size.c44
-rw-r--r--validation/optim/bits-not-zero.c30
-rw-r--r--validation/optim/bool-context-fp.c48
-rw-r--r--validation/optim/bool-int-bool.c12
-rw-r--r--validation/optim/bool-simplify.c25
-rw-r--r--validation/optim/bool-simplify2.c231
-rw-r--r--validation/optim/cast-kinds.c397
-rw-r--r--validation/optim/cast-nop.c18
9 files changed, 907 insertions, 0 deletions
diff --git a/validation/optim/bitfield-init-zero.c b/validation/optim/bitfield-init-zero.c
new file mode 100644
index 00000000..e619d1d2
--- /dev/null
+++ b/validation/optim/bitfield-init-zero.c
@@ -0,0 +1,102 @@
+struct bfu {
+ unsigned int a:11;
+ unsigned int f:9;
+ unsigned int :2;
+ unsigned int z:3;
+};
+
+struct bfu bfuu_init(unsigned int a)
+{
+ struct bfu bf = { .f = a, };
+ return bf;
+}
+
+struct bfu bfus_init(int a)
+{
+ struct bfu bf = { .f = a, };
+ return bf;
+}
+
+unsigned int bfu_get0(void)
+{
+ struct bfu bf = { };
+ return bf.f;
+}
+
+
+struct bfs {
+ signed int a:11;
+ signed int f:9;
+ signed int :2;
+ signed int z:3;
+};
+
+struct bfs bfsu_init(unsigned int a)
+{
+ struct bfs bf = { .f = a, };
+ return bf;
+}
+
+struct bfs bfss_init(int a)
+{
+ struct bfs bf = { .f = a, };
+ return bf;
+}
+
+int bfs_get0(void)
+{
+ struct bfs bf = { };
+ return bf.f;
+}
+
+/*
+ * check-name: bitfield implicit init zero
+ * check-command: test-linearize -Wno-decl $file
+ *
+ * check-output-start
+bfuu_init:
+.L0:
+ <entry-point>
+ and.32 %r4 <- %arg1, $511
+ shl.32 %r5 <- %r4, $11
+ ret.32 %r5
+
+
+bfus_init:
+.L2:
+ <entry-point>
+ and.32 %r13 <- %arg1, $511
+ shl.32 %r14 <- %r13, $11
+ ret.32 %r14
+
+
+bfu_get0:
+.L4:
+ <entry-point>
+ ret.32 $0
+
+
+bfsu_init:
+.L6:
+ <entry-point>
+ and.32 %r27 <- %arg1, $511
+ shl.32 %r28 <- %r27, $11
+ ret.32 %r28
+
+
+bfss_init:
+.L8:
+ <entry-point>
+ and.32 %r36 <- %arg1, $511
+ shl.32 %r37 <- %r36, $11
+ ret.32 %r37
+
+
+bfs_get0:
+.L10:
+ <entry-point>
+ ret.32 $0
+
+
+ * check-output-end
+ */
diff --git a/validation/optim/bitfield-size.c b/validation/optim/bitfield-size.c
new file mode 100644
index 00000000..0d2deeea
--- /dev/null
+++ b/validation/optim/bitfield-size.c
@@ -0,0 +1,44 @@
+struct bfu {
+ unsigned int a:4;
+ unsigned int :2;
+ unsigned int b:4;
+};
+unsigned int get__bfu_a(struct bfu bf) { return bf.a; }
+unsigned int get__bfu_b(struct bfu bf) { return bf.b; }
+unsigned int get_pbfu_a(struct bfu *bf) { return bf->a; }
+unsigned int get_pbfu_b(struct bfu *bf) { return bf->b; }
+
+
+struct bfs {
+ signed int a:4;
+ signed int :2;
+ signed int b:4;
+};
+signed int get__bfs_a(struct bfs bf) { return bf.a; }
+signed int get__bfs_b(struct bfs bf) { return bf.b; }
+signed int get_pbfs_a(struct bfs *bf) { return bf->a; }
+signed int get_pbfs_b(struct bfs *bf) { return bf->b; }
+
+
+struct bfi {
+ int a:4;
+ int :2;
+ int b:4;
+};
+unsigned int get__bfi_a(struct bfi bf) { return bf.a; }
+unsigned int get__bfi_b(struct bfi bf) { return bf.b; }
+unsigned int get_pbfi_a(struct bfi *bf) { return bf->a; }
+unsigned int get_pbfi_b(struct bfi *bf) { return bf->b; }
+
+/*
+ * check-name: bitfield size
+ * check-command: test-linearize -Wno-decl $file
+ * check-output-ignore
+ *
+ * check-output-excludes: and\\..*\\$960
+ * check-output-excludes: zext\\.
+ * check-output-pattern(8): and\\..*\\$15
+ * check-output-pattern(4): sext\\.
+ * check-output-pattern(4): trunc\\.4
+ * check-output-pattern(6): lsr\\..*\\$6
+ */
diff --git a/validation/optim/bits-not-zero.c b/validation/optim/bits-not-zero.c
new file mode 100644
index 00000000..189fe331
--- /dev/null
+++ b/validation/optim/bits-not-zero.c
@@ -0,0 +1,30 @@
+int or_not0(int a) { return a | ~0; }
+int and_not0(int a) { return a & ~0; }
+int xor_not0(int a) { return a ^ ~0; }
+
+/*
+ * check-name: bool-not-zero
+ * check-command: test-linearize -Wno-decl $file
+ *
+ * check-output-start
+or_not0:
+.L0:
+ <entry-point>
+ ret.32 $0xffffffff
+
+
+and_not0:
+.L2:
+ <entry-point>
+ ret.32 %arg1
+
+
+xor_not0:
+.L4:
+ <entry-point>
+ not.32 %r8 <- %arg1
+ ret.32 %r8
+
+
+ * check-output-end
+ */
diff --git a/validation/optim/bool-context-fp.c b/validation/optim/bool-context-fp.c
index ad075c56..50e96825 100644
--- a/validation/optim/bool-context-fp.c
+++ b/validation/optim/bool-context-fp.c
@@ -5,6 +5,10 @@ bool bfexp(float a) { return (bool)a; }
bool bfnot(float a) { return !a; }
int ifnot(float a) { return !a; }
+bool bfior(float a, float b) { return a || b; }
+int ifior(float a, float b) { return a || b; }
+bool bfand(float a, float b) { return a && b; }
+int ifand(float a, float b) { return a && b; }
/*
* check-name: bool context fp
@@ -43,5 +47,49 @@ ifnot:
ret.32 %r16
+bfior:
+.L8:
+ <entry-point>
+ setfval.32 %r19 <- 0.000000
+ fcmpune.1 %r20 <- %arg1, %r19
+ fcmpune.1 %r23 <- %arg2, %r19
+ or.1 %r24 <- %r20, %r23
+ setne.1 %r26 <- %r24, $0
+ ret.1 %r26
+
+
+ifior:
+.L10:
+ <entry-point>
+ setfval.32 %r29 <- 0.000000
+ fcmpune.1 %r30 <- %arg1, %r29
+ fcmpune.1 %r33 <- %arg2, %r29
+ or.1 %r34 <- %r30, %r33
+ zext.32 %r35 <- (1) %r34
+ ret.32 %r35
+
+
+bfand:
+.L12:
+ <entry-point>
+ setfval.32 %r38 <- 0.000000
+ fcmpune.1 %r39 <- %arg1, %r38
+ fcmpune.1 %r42 <- %arg2, %r38
+ and.1 %r43 <- %r39, %r42
+ setne.1 %r45 <- %r43, $0
+ ret.1 %r45
+
+
+ifand:
+.L14:
+ <entry-point>
+ setfval.32 %r48 <- 0.000000
+ fcmpune.1 %r49 <- %arg1, %r48
+ fcmpune.1 %r52 <- %arg2, %r48
+ and.1 %r53 <- %r49, %r52
+ zext.32 %r54 <- (1) %r53
+ ret.32 %r54
+
+
* check-output-end
*/
diff --git a/validation/optim/bool-int-bool.c b/validation/optim/bool-int-bool.c
new file mode 100644
index 00000000..de34a68b
--- /dev/null
+++ b/validation/optim/bool-int-bool.c
@@ -0,0 +1,12 @@
+_Bool beq0(_Bool a) { return (a == 0); }
+_Bool beq1(_Bool a) { return (a == 1); }
+_Bool bne0(_Bool a) { return (a != 0); }
+_Bool bne1(_Bool a) { return (a != 1); }
+
+/*
+ * check-name: bool - int - bool constants
+ * check-command: test-linearize -Wno-decl $file
+ *
+ * check-output-ignore
+ * check-output-excludes: cast\\.
+ */
diff --git a/validation/optim/bool-simplify.c b/validation/optim/bool-simplify.c
index 5b3cf449..68aabb78 100644
--- a/validation/optim/bool-simplify.c
+++ b/validation/optim/bool-simplify.c
@@ -18,6 +18,17 @@ int or_1(int a)
return a || 1;
}
+// try again but with something true but != 1
+int and_2(int a)
+{
+ return a && 2;
+}
+
+int or_2(int a)
+{
+ return a || 2;
+}
+
/*
* check-name: bool-simplify
* check-command: test-linearize -Wno-decl $file
@@ -51,5 +62,19 @@ or_1:
ret.32 $1
+and_2:
+.L8:
+ <entry-point>
+ setne.1 %r26 <- %arg1, $0
+ zext.32 %r29 <- (1) %r26
+ ret.32 %r29
+
+
+or_2:
+.L10:
+ <entry-point>
+ ret.32 $1
+
+
* check-output-end
*/
diff --git a/validation/optim/bool-simplify2.c b/validation/optim/bool-simplify2.c
new file mode 100644
index 00000000..c94b4412
--- /dev/null
+++ b/validation/optim/bool-simplify2.c
@@ -0,0 +1,231 @@
+typedef unsigned int uint;
+typedef _Bool bool;
+
+static uint ini(uint a) { return !a; }
+static bool bni(uint a) { return !a; }
+static uint ioii(uint a, uint b) { return a || b; }
+static uint iaii(uint a, uint b) { return a && b; }
+static bool boii(uint a, uint b) { return a || b; }
+static bool baii(uint a, uint b) { return a && b; }
+static uint ioiii(uint a, uint b, uint c) { return a || b || c; }
+static uint iaiii(uint a, uint b, uint c) { return a && b && c; }
+static bool boiii(uint a, uint b, uint c) { return a || b || c; }
+static bool baiii(uint a, uint b, uint c) { return a && b && c; }
+
+static uint inb(bool a) { return !a; }
+static bool bnb(bool a) { return !a; }
+static uint iobb(bool a, bool b) { return a || b; }
+static uint iabb(bool a, bool b) { return a && b; }
+static bool bobb(bool a, bool b) { return a || b; }
+static bool babb(bool a, bool b) { return a && b; }
+static uint iobbb(bool a, bool b, bool c) { return a || b || c; }
+static uint iabbb(bool a, bool b, bool c) { return a && b && c; }
+static bool bobbb(bool a, bool b, bool c) { return a || b || c; }
+static bool babbb(bool a, bool b, bool c) { return a && b && c; }
+
+/*
+ * check-name: bool-simplify2
+ * check-command: test-linearize $file
+ *
+ * check-output-pattern(36): setne\\.
+ * check-output-pattern(4): seteq\\.
+ * check-output-pattern(8): zext\\.
+ * check-output-pattern(12): and
+ * check-output-pattern(12): or
+ * check-output-end
+ *
+ * check-output-start
+ini:
+.L0:
+ <entry-point>
+ seteq.32 %r2 <- %arg1, $0
+ ret.32 %r2
+
+
+bni:
+.L2:
+ <entry-point>
+ seteq.1 %r6 <- %arg1, $0
+ ret.1 %r6
+
+
+ioii:
+.L4:
+ <entry-point>
+ setne.1 %r9 <- %arg1, $0
+ setne.1 %r11 <- %arg2, $0
+ or.1 %r12 <- %r9, %r11
+ zext.32 %r13 <- (1) %r12
+ ret.32 %r13
+
+
+iaii:
+.L6:
+ <entry-point>
+ setne.1 %r16 <- %arg1, $0
+ setne.1 %r18 <- %arg2, $0
+ and.1 %r19 <- %r16, %r18
+ zext.32 %r20 <- (1) %r19
+ ret.32 %r20
+
+
+boii:
+.L8:
+ <entry-point>
+ setne.1 %r23 <- %arg1, $0
+ setne.1 %r25 <- %arg2, $0
+ or.1 %r26 <- %r23, %r25
+ setne.1 %r28 <- %r26, $0
+ ret.1 %r28
+
+
+baii:
+.L10:
+ <entry-point>
+ setne.1 %r31 <- %arg1, $0
+ setne.1 %r33 <- %arg2, $0
+ and.1 %r34 <- %r31, %r33
+ setne.1 %r36 <- %r34, $0
+ ret.1 %r36
+
+
+ioiii:
+.L12:
+ <entry-point>
+ setne.1 %r39 <- %arg1, $0
+ setne.1 %r41 <- %arg2, $0
+ or.1 %r42 <- %r39, %r41
+ setne.1 %r44 <- %r42, $0
+ setne.1 %r46 <- %arg3, $0
+ or.1 %r47 <- %r44, %r46
+ zext.32 %r48 <- (1) %r47
+ ret.32 %r48
+
+
+iaiii:
+.L14:
+ <entry-point>
+ setne.1 %r51 <- %arg1, $0
+ setne.1 %r53 <- %arg2, $0
+ and.1 %r54 <- %r51, %r53
+ setne.1 %r56 <- %r54, $0
+ setne.1 %r58 <- %arg3, $0
+ and.1 %r59 <- %r56, %r58
+ zext.32 %r60 <- (1) %r59
+ ret.32 %r60
+
+
+boiii:
+.L16:
+ <entry-point>
+ setne.1 %r63 <- %arg1, $0
+ setne.1 %r65 <- %arg2, $0
+ or.1 %r66 <- %r63, %r65
+ setne.1 %r68 <- %r66, $0
+ setne.1 %r70 <- %arg3, $0
+ or.1 %r71 <- %r68, %r70
+ setne.1 %r73 <- %r71, $0
+ ret.1 %r73
+
+
+baiii:
+.L18:
+ <entry-point>
+ setne.1 %r76 <- %arg1, $0
+ setne.1 %r78 <- %arg2, $0
+ and.1 %r79 <- %r76, %r78
+ setne.1 %r81 <- %r79, $0
+ setne.1 %r83 <- %arg3, $0
+ and.1 %r84 <- %r81, %r83
+ setne.1 %r86 <- %r84, $0
+ ret.1 %r86
+
+
+inb:
+.L20:
+ <entry-point>
+ seteq.32 %r89 <- %arg1, $0
+ ret.32 %r89
+
+
+bnb:
+.L22:
+ <entry-point>
+ seteq.1 %r93 <- %arg1, $0
+ ret.1 %r93
+
+
+iobb:
+.L24:
+ <entry-point>
+ or.1 %r97 <- %arg1, %arg2
+ zext.32 %r98 <- (1) %r97
+ ret.32 %r98
+
+
+iabb:
+.L26:
+ <entry-point>
+ and.1 %r102 <- %arg1, %arg2
+ zext.32 %r103 <- (1) %r102
+ ret.32 %r103
+
+
+bobb:
+.L28:
+ <entry-point>
+ or.1 %r107 <- %arg1, %arg2
+ setne.1 %r109 <- %r107, $0
+ ret.1 %r109
+
+
+babb:
+.L30:
+ <entry-point>
+ and.1 %r113 <- %arg1, %arg2
+ setne.1 %r115 <- %r113, $0
+ ret.1 %r115
+
+
+iobbb:
+.L32:
+ <entry-point>
+ or.1 %r119 <- %arg1, %arg2
+ setne.1 %r121 <- %r119, $0
+ or.1 %r123 <- %r121, %arg3
+ zext.32 %r124 <- (1) %r123
+ ret.32 %r124
+
+
+iabbb:
+.L34:
+ <entry-point>
+ and.1 %r128 <- %arg1, %arg2
+ setne.1 %r130 <- %r128, $0
+ and.1 %r132 <- %r130, %arg3
+ zext.32 %r133 <- (1) %r132
+ ret.32 %r133
+
+
+bobbb:
+.L36:
+ <entry-point>
+ or.1 %r137 <- %arg1, %arg2
+ setne.1 %r139 <- %r137, $0
+ or.1 %r141 <- %r139, %arg3
+ setne.1 %r143 <- %r141, $0
+ ret.1 %r143
+
+
+babbb:
+.L38:
+ <entry-point>
+ and.1 %r147 <- %arg1, %arg2
+ setne.1 %r149 <- %r147, $0
+ and.1 %r151 <- %r149, %arg3
+ setne.1 %r153 <- %r151, $0
+ ret.1 %r153
+
+
+ * check-output-end
+ */
diff --git a/validation/optim/cast-kinds.c b/validation/optim/cast-kinds.c
new file mode 100644
index 00000000..b144dc7e
--- /dev/null
+++ b/validation/optim/cast-kinds.c
@@ -0,0 +1,397 @@
+typedef unsigned int uint;
+typedef unsigned long ulong;
+
+static int uint_2_int(uint a) { return (int)a; }
+static int long_2_int(long a) { return (int)a; }
+static int ulong_2_int(ulong a) { return (int)a; }
+static int vptr_2_int(void *a) { return (int)a; }
+static int iptr_2_int(int *a) { return (int)a; }
+static int float_2_int(float a) { return (int)a; }
+static int double_2_int(double a) { return (int)a; }
+static uint int_2_uint(int a) { return (uint)a; }
+static uint long_2_uint(long a) { return (uint)a; }
+static uint ulong_2_uint(ulong a) { return (uint)a; }
+static uint vptr_2_uint(void *a) { return (uint)a; }
+static uint iptr_2_uint(int *a) { return (uint)a; }
+static uint float_2_uint(float a) { return (uint)a; }
+static uint double_2_uint(double a) { return (uint)a; }
+static long int_2_long(int a) { return (long)a; }
+static long uint_2_long(uint a) { return (long)a; }
+static long ulong_2_long(ulong a) { return (long)a; }
+static long vptr_2_long(void *a) { return (long)a; }
+static long iptr_2_long(int *a) { return (long)a; }
+static long float_2_long(float a) { return (long)a; }
+static long double_2_long(double a) { return (long)a; }
+static ulong int_2_ulong(int a) { return (ulong)a; }
+static ulong uint_2_ulong(uint a) { return (ulong)a; }
+static ulong long_2_ulong(long a) { return (ulong)a; }
+static ulong vptr_2_ulong(void *a) { return (ulong)a; }
+static ulong iptr_2_ulong(int *a) { return (ulong)a; }
+static ulong float_2_ulong(float a) { return (ulong)a; }
+static ulong double_2_ulong(double a) { return (ulong)a; }
+static void * int_2_vptr(int a) { return (void *)a; }
+static void * uint_2_vptr(uint a) { return (void *)a; }
+static void * long_2_vptr(long a) { return (void *)a; }
+static void * ulong_2_vptr(ulong a) { return (void *)a; }
+static void * iptr_2_vptr(int *a) { return (void *)a; }
+static int * int_2_iptr(int a) { return (int *)a; }
+static int * uint_2_iptr(uint a) { return (int *)a; }
+static int * long_2_iptr(long a) { return (int *)a; }
+static int * ulong_2_iptr(ulong a) { return (int *)a; }
+static int * vptr_2_iptr(void *a) { return (int *)a; }
+static float int_2_float(int a) { return (float)a; }
+static float uint_2_float(uint a) { return (float)a; }
+static float long_2_float(long a) { return (float)a; }
+static float ulong_2_float(ulong a) { return (float)a; }
+static float double_2_float(double a) { return (float)a; }
+static double int_2_double(int a) { return (double)a; }
+static double uint_2_double(uint a) { return (double)a; }
+static double long_2_double(long a) { return (double)a; }
+static double ulong_2_double(ulong a) { return (double)a; }
+static double float_2_double(float a) { return (double)a; }
+
+static float float_2_float(float a) { return a; }
+static double double_2_double(double a) { return a; }
+
+/*
+ * check-name: cast-kinds
+ * check-command: test-linearize -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -m64 $file
+ *
+ * check-output-start
+uint_2_int:
+.L0:
+ <entry-point>
+ ret.32 %arg1
+
+
+long_2_int:
+.L2:
+ <entry-point>
+ trunc.32 %r4 <- (64) %arg1
+ ret.32 %r4
+
+
+ulong_2_int:
+.L4:
+ <entry-point>
+ trunc.32 %r7 <- (64) %arg1
+ ret.32 %r7
+
+
+vptr_2_int:
+.L6:
+ <entry-point>
+ trunc.32 %r10 <- (64) %arg1
+ ret.32 %r10
+
+
+iptr_2_int:
+.L8:
+ <entry-point>
+ trunc.32 %r14 <- (64) %arg1
+ ret.32 %r14
+
+
+float_2_int:
+.L10:
+ <entry-point>
+ fcvts.32 %r17 <- (32) %arg1
+ ret.32 %r17
+
+
+double_2_int:
+.L12:
+ <entry-point>
+ fcvts.32 %r20 <- (64) %arg1
+ ret.32 %r20
+
+
+int_2_uint:
+.L14:
+ <entry-point>
+ ret.32 %arg1
+
+
+long_2_uint:
+.L16:
+ <entry-point>
+ trunc.32 %r25 <- (64) %arg1
+ ret.32 %r25
+
+
+ulong_2_uint:
+.L18:
+ <entry-point>
+ trunc.32 %r28 <- (64) %arg1
+ ret.32 %r28
+
+
+vptr_2_uint:
+.L20:
+ <entry-point>
+ trunc.32 %r31 <- (64) %arg1
+ ret.32 %r31
+
+
+iptr_2_uint:
+.L22:
+ <entry-point>
+ trunc.32 %r35 <- (64) %arg1
+ ret.32 %r35
+
+
+float_2_uint:
+.L24:
+ <entry-point>
+ fcvtu.32 %r38 <- (32) %arg1
+ ret.32 %r38
+
+
+double_2_uint:
+.L26:
+ <entry-point>
+ fcvtu.32 %r41 <- (64) %arg1
+ ret.32 %r41
+
+
+int_2_long:
+.L28:
+ <entry-point>
+ sext.64 %r44 <- (32) %arg1
+ ret.64 %r44
+
+
+uint_2_long:
+.L30:
+ <entry-point>
+ zext.64 %r47 <- (32) %arg1
+ ret.64 %r47
+
+
+ulong_2_long:
+.L32:
+ <entry-point>
+ ret.64 %arg1
+
+
+vptr_2_long:
+.L34:
+ <entry-point>
+ ret.64 %arg1
+
+
+iptr_2_long:
+.L36:
+ <entry-point>
+ ret.64 %arg1
+
+
+float_2_long:
+.L38:
+ <entry-point>
+ fcvts.64 %r57 <- (32) %arg1
+ ret.64 %r57
+
+
+double_2_long:
+.L40:
+ <entry-point>
+ fcvts.64 %r60 <- (64) %arg1
+ ret.64 %r60
+
+
+int_2_ulong:
+.L42:
+ <entry-point>
+ sext.64 %r63 <- (32) %arg1
+ ret.64 %r63
+
+
+uint_2_ulong:
+.L44:
+ <entry-point>
+ zext.64 %r66 <- (32) %arg1
+ ret.64 %r66
+
+
+long_2_ulong:
+.L46:
+ <entry-point>
+ ret.64 %arg1
+
+
+vptr_2_ulong:
+.L48:
+ <entry-point>
+ ret.64 %arg1
+
+
+iptr_2_ulong:
+.L50:
+ <entry-point>
+ ret.64 %arg1
+
+
+float_2_ulong:
+.L52:
+ <entry-point>
+ fcvtu.64 %r76 <- (32) %arg1
+ ret.64 %r76
+
+
+double_2_ulong:
+.L54:
+ <entry-point>
+ fcvtu.64 %r79 <- (64) %arg1
+ ret.64 %r79
+
+
+int_2_vptr:
+.L56:
+ <entry-point>
+ sext.64 %r82 <- (32) %arg1
+ ret.64 %r82
+
+
+uint_2_vptr:
+.L58:
+ <entry-point>
+ zext.64 %r85 <- (32) %arg1
+ ret.64 %r85
+
+
+long_2_vptr:
+.L60:
+ <entry-point>
+ ret.64 %arg1
+
+
+ulong_2_vptr:
+.L62:
+ <entry-point>
+ ret.64 %arg1
+
+
+iptr_2_vptr:
+.L64:
+ <entry-point>
+ ret.64 %arg1
+
+
+int_2_iptr:
+.L66:
+ <entry-point>
+ sext.64 %r94 <- (32) %arg1
+ ret.64 %r94
+
+
+uint_2_iptr:
+.L68:
+ <entry-point>
+ zext.64 %r98 <- (32) %arg1
+ ret.64 %r98
+
+
+long_2_iptr:
+.L70:
+ <entry-point>
+ ret.64 %arg1
+
+
+ulong_2_iptr:
+.L72:
+ <entry-point>
+ ret.64 %arg1
+
+
+vptr_2_iptr:
+.L74:
+ <entry-point>
+ ptrcast.64 %r108 <- (64) %arg1
+ ret.64 %r108
+
+
+int_2_float:
+.L76:
+ <entry-point>
+ scvtf.32 %r111 <- (32) %arg1
+ ret.32 %r111
+
+
+uint_2_float:
+.L78:
+ <entry-point>
+ ucvtf.32 %r114 <- (32) %arg1
+ ret.32 %r114
+
+
+long_2_float:
+.L80:
+ <entry-point>
+ scvtf.32 %r117 <- (64) %arg1
+ ret.32 %r117
+
+
+ulong_2_float:
+.L82:
+ <entry-point>
+ ucvtf.32 %r120 <- (64) %arg1
+ ret.32 %r120
+
+
+double_2_float:
+.L84:
+ <entry-point>
+ fcvtf.32 %r123 <- (64) %arg1
+ ret.32 %r123
+
+
+int_2_double:
+.L86:
+ <entry-point>
+ scvtf.64 %r126 <- (32) %arg1
+ ret.64 %r126
+
+
+uint_2_double:
+.L88:
+ <entry-point>
+ ucvtf.64 %r129 <- (32) %arg1
+ ret.64 %r129
+
+
+long_2_double:
+.L90:
+ <entry-point>
+ scvtf.64 %r132 <- (64) %arg1
+ ret.64 %r132
+
+
+ulong_2_double:
+.L92:
+ <entry-point>
+ ucvtf.64 %r135 <- (64) %arg1
+ ret.64 %r135
+
+
+float_2_double:
+.L94:
+ <entry-point>
+ fcvtf.64 %r138 <- (32) %arg1
+ ret.64 %r138
+
+
+float_2_float:
+.L96:
+ <entry-point>
+ ret.32 %arg1
+
+
+double_2_double:
+.L98:
+ <entry-point>
+ ret.64 %arg1
+
+
+ * check-output-end
+ */
diff --git a/validation/optim/cast-nop.c b/validation/optim/cast-nop.c
new file mode 100644
index 00000000..7741b7a7
--- /dev/null
+++ b/validation/optim/cast-nop.c
@@ -0,0 +1,18 @@
+static long p2l(long *p)
+{
+ return (long) p;
+}
+
+static long *l2p(long l)
+{
+ return (long*)l;
+}
+
+/*
+ * check-name: cast-nop
+ * check-command: test-linearize -Wno-decl $file
+ *
+ * check-output-ignore
+ * check-output-excludes: utptr\\.
+ * check-output-excludes: ptrtu\\.
+ */