diff options
author | John McCall <rjmccall@apple.com> | 2011-06-25 01:32:37 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-06-25 01:32:37 +0000 |
commit | 77527a8e652e3cef5887db8923743c9f89950234 (patch) | |
tree | 4c7ad96bbc4876b79fdb447876ee7509fbfd93bd /clang/test/CodeGenCXX/vla.cpp | |
parent | c15b0cfc1f89cb8d9779189892d733e2d23d8866 (diff) | |
download | bcm5719-llvm-77527a8e652e3cef5887db8923743c9f89950234.tar.gz bcm5719-llvm-77527a8e652e3cef5887db8923743c9f89950234.zip |
Mark the multiply which occurs as part of performing pointer
arithmetic on a VLA as 'nsw', per discussion with djg, and
implement pointer arithmetic (other than array accesses) and
pointer subtraction for VLA types.
llvm-svn: 133855
Diffstat (limited to 'clang/test/CodeGenCXX/vla.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/vla.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/CodeGenCXX/vla.cpp b/clang/test/CodeGenCXX/vla.cpp index cee00f27713..58cdf795ee5 100644 --- a/clang/test/CodeGenCXX/vla.cpp +++ b/clang/test/CodeGenCXX/vla.cpp @@ -24,14 +24,14 @@ void test0(void *array, int n) { array_t &ref = *(array_t*) array; // CHECK-NEXT: [[T0:%.*]] = load i16** [[REF]] - // CHECK-NEXT: [[T1:%.*]] = mul i64 1, [[DIM1]] + // CHECK-NEXT: [[T1:%.*]] = mul nsw i64 1, [[DIM1]] // CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds i16* [[T0]], i64 [[T1]] // CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i16* [[T2]], i64 2 // CHECK-NEXT: store i16 3, i16* [[T3]] ref[1][2] = 3; // CHECK-NEXT: [[T0:%.*]] = load i16** [[REF]] - // CHECK-NEXT: [[T1:%.*]] = mul i64 4, [[DIM1]] + // CHECK-NEXT: [[T1:%.*]] = mul nsw i64 4, [[DIM1]] // CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds i16* [[T0]], i64 [[T1]] // CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds i16* [[T2]], i64 5 // CHECK-NEXT: [[T4:%.*]] = load i16* [[T3]] |