blob: aacf76a6338ba0d6c5d5e2f63fb162a3553cee7b [file] [log] [blame]
Eric Christopher53b2cb72017-06-30 00:03:56 +00001// RUN: %clang_cc1 -triple armv7s-linux-gnu -target-abi apcs-gnu -emit-llvm -o - %s \
Ahmed Bougacha01950a02015-06-04 20:58:49 +00002// RUN: -target-feature +neon -target-cpu cortex-a8 \
3// RUN: -fsanitize=signed-integer-overflow \
4// RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=ARMV7
5
Tim Northover58672972016-03-09 18:54:42 +00006// RUN: %clang_cc1 -triple aarch64-unknown-unknown -emit-llvm -o - %s \
Ahmed Bougacha01950a02015-06-04 20:58:49 +00007// RUN: -target-feature +neon -target-cpu cortex-a53 \
8// RUN: -fsanitize=signed-integer-overflow \
9// RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=AARCH64
10
11// Verify we emit constants for "immediate" builtin arguments.
12// Emitting a scalar expression can make the immediate be generated as
13// overflow intrinsics, if the overflow sanitizer is enabled.
14
15// PR23517
16
17#include <arm_neon.h>
18
19int32x2_t test_vqrshrn_n_s64(int64x2_t a) {
20 // CHECK-LABEL: @test_vqrshrn_n_s64
21 // CHECK-AARCH64: call <2 x i32> @llvm.aarch64.neon.sqrshrn.v2i32(<2 x i64> {{.*}}, i32 1)
22 // CHECK-ARMV7: call <2 x i32> @llvm.arm.neon.vqrshiftns.v2i32(<2 x i64> {{.*}}, <2 x i64> <i64 -1, i64 -1>)
23 return vqrshrn_n_s64(a, 0 + 1);
24}