• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -triple i386-unknown-unknown -O1 -emit-llvm -o - %s | FileCheck %s
2 // CHECK-LABEL: define i32 @f0
3 // CHECK:   ret i32 1
4 // CHECK-LABEL: define i32 @f1
5 // CHECK:   ret i32 1
6 // CHECK-LABEL: define i32 @f2
7 // CHECK:   ret i32 1
8 // <rdr://6115726>
9 
f0()10 int f0() {
11   int x;
12   unsigned short n = 1;
13   int *a = &x;
14   int *b = &x;
15   a = a - n;
16   b -= n;
17   return a == b;
18 }
19 
f1(int * a)20 int f1(int *a) {
21   long b = a - (int*) 1;
22   a -= (int*) 1;
23   return b == (long) a;
24 }
25 
f2(long n)26 int f2(long n) {
27   int *b = n + (int*) 1;
28   n += (int*) 1;
29   return b == (int*) n;
30 }
31 
32