From: Ahmed Bougacha Date: Thu, 4 Jun 2015 20:58:49 +0000 (+0000) Subject: [CodeGen] Add testcase for r239002. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=211d544fb1882f9faaeea03378942a40696e477f;p=clang [CodeGen] Add testcase for r239002. Just realized I forgot to add it when committing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239093 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/neon-immediate-ubsan.c b/test/CodeGen/neon-immediate-ubsan.c new file mode 100644 index 0000000000..3fe4b00397 --- /dev/null +++ b/test/CodeGen/neon-immediate-ubsan.c @@ -0,0 +1,24 @@ +// RUN: %clang_cc1 -triple armv7s-linux-gnu -emit-llvm -O1 -o - %s \ +// RUN: -target-feature +neon -target-cpu cortex-a8 \ +// RUN: -fsanitize=signed-integer-overflow \ +// RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=ARMV7 + +// RUN: %clang_cc1 -triple aarch64-unknown-unknown -emit-llvm -O1 -o - %s \ +// RUN: -target-feature +neon -target-cpu cortex-a53 \ +// RUN: -fsanitize=signed-integer-overflow \ +// RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=AARCH64 + +// Verify we emit constants for "immediate" builtin arguments. +// Emitting a scalar expression can make the immediate be generated as +// overflow intrinsics, if the overflow sanitizer is enabled. + +// PR23517 + +#include + +int32x2_t test_vqrshrn_n_s64(int64x2_t a) { + // CHECK-LABEL: @test_vqrshrn_n_s64 + // CHECK-AARCH64: call <2 x i32> @llvm.aarch64.neon.sqrshrn.v2i32(<2 x i64> {{.*}}, i32 1) + // CHECK-ARMV7: call <2 x i32> @llvm.arm.neon.vqrshiftns.v2i32(<2 x i64> {{.*}}, <2 x i64> ) + return vqrshrn_n_s64(a, 0 + 1); +}