Daniel Dunbar | 8c6f57c | 2008-08-06 02:00:38 +0000 | [diff] [blame] | 1 | // RUN: clang -emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis | grep "ret i32 1" | count 3 |
2 | // <rdr://6115726> | ||||
3 | |||||
4 | int f0() { | ||||
5 | int x; | ||||
6 | unsigned short n = 1; | ||||
7 | int *a = &x; | ||||
8 | int *b = &x; | ||||
9 | a = a - n; | ||||
10 | b -= n; | ||||
11 | return a == b; | ||||
12 | } | ||||
13 | |||||
14 | int f1(int *a) { | ||||
15 | int b = a - (int*) 1; | ||||
16 | a -= (int*) 1; | ||||
17 | return b == (int) a; | ||||
18 | } | ||||
19 | |||||
20 | int f2(int n) { | ||||
21 | int *b = n + (int*) 1; | ||||
22 | n += (int*) 1; | ||||
23 | return b == (int*) n; | ||||
24 | } | ||||
25 |