Mikhail Maltsev | ffaa8a8 | 2018-04-27 09:12:12 +0000 | [diff] [blame] | 1 | ; RUN: opt -instcombine -S < %s | FileCheck %s |
| 2 | |
| 3 | target datalayout = "e-p:32:32-n32-S64" |
| 4 | |
| 5 | ; CHECK-LABEL: @foo_ptr |
| 6 | ; CHECK: and |
| 7 | define i32 @foo_ptr() { |
| 8 | entry: |
| 9 | ; Even though the address of @foo is aligned, we cannot assume that the |
| 10 | ; pointer has the same alignment. This is not true for e.g. ARM targets |
| 11 | ; which store ARM/Thumb state in the LSB |
| 12 | ret i32 and (i32 ptrtoint (void ()* @foo to i32), i32 -4) |
| 13 | } |
| 14 | |
| 15 | define internal void @foo() align 16 { |
| 16 | entry: |
| 17 | ret void |
| 18 | } |