Files
clang-p2996/clang/test/CodeGen/RISCV/riscv-v-lifetime.cpp
Nikita Popov 532dc62b90 [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC)
This adds -no-opaque-pointers to clang tests whose output will
change when opaque pointers are enabled by default. This is
intended to be part of the migration approach described in
https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322/9.

The patch has been produced by replacing %clang_cc1 with
%clang_cc1 -no-opaque-pointers for tests that fail with opaque
pointers enabled. Worth noting that this doesn't cover all tests,
there's a remaining ~40 tests not using %clang_cc1 that will need
a followup change.

Differential Revision: https://reviews.llvm.org/D123115
2022-04-07 12:09:47 +02:00

26 lines
1.1 KiB
C++

// REQUIRES: riscv-registered-target
// RUN: %clang_cc1 -no-opaque-pointers -std=c++11 -triple riscv64 -target-feature +v \
// RUN: -O1 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s
#include <riscv_vector.h>
vint32m1_t Baz();
// CHECK-LABEL: @_Z4Testv(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[A:%.*]] = alloca <vscale x 2 x i32>*, align 8
// CHECK-NEXT: [[REF_TMP:%.*]] = alloca <vscale x 2 x i32>, align 4
// CHECK-NEXT: [[TMP0:%.*]] = bitcast <vscale x 2 x i32>** [[A]] to i8*
// CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 8, i8* [[TMP0]]) #[[ATTR3:[0-9]+]]
// CHECK-NEXT: [[TMP1:%.*]] = bitcast <vscale x 2 x i32>* [[REF_TMP]] to i8*
// CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 -1, i8* [[TMP1]]) #[[ATTR3]]
// CHECK: [[TMP4:%.*]] = bitcast <vscale x 2 x i32>* [[REF_TMP]] to i8*
// CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 -1, i8* [[TMP4]]) #[[ATTR3]]
// CHECK-NEXT: [[TMP5:%.*]] = bitcast <vscale x 2 x i32>** [[A]] to i8*
// CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 8, i8* [[TMP5]]) #[[ATTR3]]
//
vint32m1_t Test() {
const vint32m1_t &a = Baz();
return a;
}