diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2014-05-28 09:56:42 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2014-05-28 09:56:42 +0000 |
commit | 9b46eb81127be4a7560952677294d3c376648c08 (patch) | |
tree | 99e4aa165636c60d4f0e903a00b1f41e7976a6ae /clang/test/CodeGenCXX/reference-cast.cpp | |
parent | a09b70579a8cbddbd677250916e82cf43932bd99 (diff) | |
download | bcm5719-llvm-9b46eb81127be4a7560952677294d3c376648c08.tar.gz bcm5719-llvm-9b46eb81127be4a7560952677294d3c376648c08.zip |
Add 'nonnull' parameter or return attribute when producing an llvm pointer type in a function type where the C++ type is a reference. Update the tests.
llvm-svn: 209723
Diffstat (limited to 'clang/test/CodeGenCXX/reference-cast.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/reference-cast.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/clang/test/CodeGenCXX/reference-cast.cpp b/clang/test/CodeGenCXX/reference-cast.cpp index 60ea393af96..0596ceb3b42 100644 --- a/clang/test/CodeGenCXX/reference-cast.cpp +++ b/clang/test/CodeGenCXX/reference-cast.cpp @@ -3,7 +3,7 @@ // PR6024 extern int i; -// CHECK: define i32* @_Z16lvalue_noop_castv() [[NUW:#[0-9]+]] +// CHECK: define nonnull i32* @_Z16lvalue_noop_castv() [[NUW:#[0-9]+]] const int &lvalue_noop_cast() { if (i == 0) // CHECK: store i32 17, i32* @@ -15,7 +15,7 @@ const int &lvalue_noop_cast() { return 17; } -// CHECK-LABEL: define i16* @_Z20lvalue_integral_castv() +// CHECK-LABEL: define nonnull i16* @_Z20lvalue_integral_castv() const short &lvalue_integral_cast() { if (i == 0) // CHECK: store i16 17, i16* @@ -27,7 +27,7 @@ const short &lvalue_integral_cast() { return 17; } -// CHECK-LABEL: define i16* @_Z29lvalue_floating_integral_castv() +// CHECK-LABEL: define nonnull i16* @_Z29lvalue_floating_integral_castv() const short &lvalue_floating_integral_cast() { if (i == 0) // CHECK: store i16 17, i16* @@ -39,7 +39,7 @@ const short &lvalue_floating_integral_cast() { return 17.5; } -// CHECK-LABEL: define float* @_Z29lvalue_integral_floating_castv() +// CHECK-LABEL: define nonnull float* @_Z29lvalue_integral_floating_castv() const float &lvalue_integral_floating_cast() { if (i == 0) // CHECK: store float 1.700000e+{{0*}}1, float* @@ -51,7 +51,7 @@ const float &lvalue_integral_floating_cast() { return 17; } -// CHECK-LABEL: define float* @_Z20lvalue_floating_castv() +// CHECK-LABEL: define nonnull float* @_Z20lvalue_floating_castv() const float &lvalue_floating_cast() { if (i == 0) // CHECK: store float 1.700000e+{{0*}}1, float* @@ -65,7 +65,7 @@ const float &lvalue_floating_cast() { int get_int(); -// CHECK-LABEL: define i8* @_Z24lvalue_integer_bool_castv() +// CHECK-LABEL: define nonnull i8* @_Z24lvalue_integer_bool_castv() const bool &lvalue_integer_bool_cast() { if (i == 0) // CHECK: call i32 @_Z7get_intv() @@ -82,7 +82,7 @@ const bool &lvalue_integer_bool_cast() { float get_float(); -// CHECK-LABEL: define i8* @_Z25lvalue_floating_bool_castv() +// CHECK-LABEL: define nonnull i8* @_Z25lvalue_floating_bool_castv() const bool &lvalue_floating_bool_cast() { if (i == 0) // CHECK: call float @_Z9get_floatv() @@ -107,7 +107,7 @@ typedef int (X::*pmf)(int); pm get_pointer_to_member_data(); pmf get_pointer_to_member_function(); -// CHECK-LABEL: define i8* @_Z26lvalue_ptrmem_to_bool_castv() +// CHECK-LABEL: define nonnull i8* @_Z26lvalue_ptrmem_to_bool_castv() const bool &lvalue_ptrmem_to_bool_cast() { if (i == 0) // CHECK: call i64 @_Z26get_pointer_to_member_datav() @@ -125,7 +125,7 @@ const bool &lvalue_ptrmem_to_bool_cast() { return get_pointer_to_member_data(); } -// CHECK-LABEL: define i8* @_Z27lvalue_ptrmem_to_bool_cast2v +// CHECK-LABEL: define nonnull i8* @_Z27lvalue_ptrmem_to_bool_cast2v const bool &lvalue_ptrmem_to_bool_cast2() { if (i == 0) // CHECK: {{call.*_Z30get_pointer_to_member_functionv}} |