NAKAMURA Takumi | 5731b5c | 2011-02-22 07:20:35 +0000 | [diff] [blame^] | 1 | ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s |
| 2 | ; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s |
Dan Gohman | 968cb93 | 2010-02-17 00:41:53 +0000 | [diff] [blame] | 3 | |
| 4 | ; The comparison uses the pre-inc value, which could lead LSR to |
| 5 | ; try to compute -INT64_MIN. |
| 6 | |
Dan Gohman | 2a5431e | 2010-02-17 01:08:57 +0000 | [diff] [blame] | 7 | ; CHECK: movabsq $-9223372036854775808, %rax |
NAKAMURA Takumi | 5731b5c | 2011-02-22 07:20:35 +0000 | [diff] [blame^] | 8 | ; CHECK: cmpq %rax, |
Dan Gohman | 968cb93 | 2010-02-17 00:41:53 +0000 | [diff] [blame] | 9 | ; CHECK: sete %al |
| 10 | |
| 11 | declare i64 @bar() |
| 12 | |
| 13 | define i1 @foo() nounwind { |
| 14 | entry: |
| 15 | br label %for.cond.i |
| 16 | |
| 17 | for.cond.i: |
| 18 | %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.cond.i ] |
| 19 | %t = call i64 @bar() |
| 20 | %indvar.next = add i64 %indvar, 1 |
| 21 | %s = icmp ne i64 %indvar.next, %t |
| 22 | br i1 %s, label %for.cond.i, label %__ABContainsLabel.exit |
| 23 | |
| 24 | __ABContainsLabel.exit: |
| 25 | %cmp = icmp eq i64 %indvar, 9223372036854775807 |
| 26 | ret i1 %cmp |
| 27 | } |