[Heikki Kultala] This patch contains the ABI changes for the TCE target.
[clang.git] / test / CodeGen / 2008-07-31-promotion-of-compound-pointer-arithmetic.c
blobde062631f93bb827d8e1bbaaeb2b974f8f074656
1 // RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis | grep "ret i32 1" | count 3
2 // <rdr://6115726>
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;
14 int f1(int *a) {
15 long b = a - (int*) 1;
16 a -= (int*) 1;
17 return b == (long) a;
20 int f2(long n) {
21 int *b = n + (int*) 1;
22 n += (int*) 1;
23 return b == (int*) n;