File: neon-immediate-ubsan.c

package info (click to toggle)
llvm-toolchain-3.9 1%3A3.9.1-9
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 441,144 kB
  • ctags: 428,836
  • sloc: cpp: 2,546,577; ansic: 538,318; asm: 119,677; objc: 103,316; python: 102,148; sh: 27,847; pascal: 5,626; ml: 5,510; perl: 5,293; lisp: 4,801; makefile: 2,177; xml: 686; cs: 362; php: 212; csh: 117
file content (24 lines) | stat: -rw-r--r-- 1,044 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// RUN: %clang_cc1 -triple armv7s-linux-gnu -emit-llvm -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 -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 <arm_neon.h>

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> <i64 -1, i64 -1>)
  return vqrshrn_n_s64(a, 0 + 1);
}