From: Roger Sayle Date: Wed, 8 Dec 2021 13:21:49 +0000 (+0100) Subject: nvptx: Add test-case gcc.target/nvptx/exttrunc-1.c X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d3d44a00e511f0402e8a2449c1c9c27f28ac9cf7;p=test_jj.git nvptx: Add test-case gcc.target/nvptx/exttrunc-1.c Add new test-case converting short to char and back to short. Tested on nvptx. gcc/testsuite/ChangeLog: * gcc.target/nvptx/exttrunc-1.c: New test case. --- diff --git a/gcc/testsuite/gcc.target/nvptx/exttrunc-1.c b/gcc/testsuite/gcc.target/nvptx/exttrunc-1.c new file mode 100644 index 0000000..ed9ceee --- /dev/null +++ b/gcc/testsuite/gcc.target/nvptx/exttrunc-1.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +short exttrunc_hi2_qi(short x) +{ + return (char)x; +} + +/* Match: + mov.u32 %r24, %ar0; + cvt.u32.u32 %r26, %r24; + cvt.s32.s8 %value, %r26; + Todo: Remove cvt.u32.u32. */ + +/* { dg-final { scan-assembler-times "mov\.u32\t%r\[0-9\]*, %ar0" 1 } } */ +/* { dg-final { scan-assembler-times "mov\." 1 } } */ + +/* { dg-final { scan-assembler-times "cvt\.u32\.u32" 1 } } */ +/* { dg-final { scan-assembler-times "cvt\.s32\.s8" 1 } } */ +/* { dg-final { scan-assembler-times "cvt\." 2 } } */