Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -emit-llvm %s -o %t -triple=x86_64-apple-darwin9 |
Anders Carlsson | 237957c | 2009-08-09 18:26:27 +0000 | [diff] [blame] | 2 | |
| 3 | struct A { |
| 4 | int i; |
| 5 | }; |
| 6 | |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 7 | // RUN: grep "@a = global i64 -1" %t |
Anders Carlsson | 237957c | 2009-08-09 18:26:27 +0000 | [diff] [blame] | 8 | int A::* a; |
| 9 | |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 10 | // RUN: grep "@aa = global \[2 x i64\] \[i64 -1, i64 -1\]" %t |
Anders Carlsson | 237957c | 2009-08-09 18:26:27 +0000 | [diff] [blame] | 11 | int A::* aa[2]; |
| 12 | |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 13 | // RUN: grep "@aaa = global \[2 x \[2 x i64\]\] \[\[2 x i64\] \[i64 -1, i64 -1\], \[2 x i64\] \[i64 -1, i64 -1\]\]" %t |
Anders Carlsson | 237957c | 2009-08-09 18:26:27 +0000 | [diff] [blame] | 14 | int A::* aaa[2][2]; |
| 15 | |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 16 | // RUN: grep "@b = global i64 -1" %t |
Anders Carlsson | d1a9bac | 2009-08-23 00:02:11 +0000 | [diff] [blame] | 17 | int A::* b = 0; |
| 18 | |
Anders Carlsson | 237957c | 2009-08-09 18:26:27 +0000 | [diff] [blame] | 19 | void f() { |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 20 | // RUN: grep "%.* = icmp ne i64 %.*, -1" %t | count 2 |
Anders Carlsson | 237957c | 2009-08-09 18:26:27 +0000 | [diff] [blame] | 21 | if (a) { } |
Anders Carlsson | e977624 | 2009-08-24 18:26:39 +0000 | [diff] [blame] | 22 | if (a != 0) { } |
| 23 | |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 24 | // RUN: grep "%.* = icmp ne i64 -1, %.*" %t | count 1 |
Anders Carlsson | e977624 | 2009-08-24 18:26:39 +0000 | [diff] [blame] | 25 | if (0 != a) { } |
Anders Carlsson | 237957c | 2009-08-09 18:26:27 +0000 | [diff] [blame] | 26 | |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 27 | // RUN: grep "%.* = icmp eq i64 %.*, -1" %t | count 1 |
Anders Carlsson | e977624 | 2009-08-24 18:26:39 +0000 | [diff] [blame] | 28 | if (a == 0) { } |
| 29 | |
| 30 | // RUN: grep "%.* = icmp eq i64 -1, %.*" %t | count 1 |
| 31 | if (0 == a) { } |
Anders Carlsson | 237957c | 2009-08-09 18:26:27 +0000 | [diff] [blame] | 32 | |
| 33 | } |
| 34 | |