Chris Lattner | bfee2cc | 2004-11-26 19:19:28 +0000 | [diff] [blame] | 1 | ; A store or load cannot alias a global if the accessed amount is larger then |
2 | ; the global. | ||||
3 | |||||
Reid Spencer | d0e30dc | 2006-12-02 04:23:10 +0000 | [diff] [blame] | 4 | ; RUN: llvm-upgrade < %s | llvm-as | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep load |
Chris Lattner | bfee2cc | 2004-11-26 19:19:28 +0000 | [diff] [blame] | 5 | |
6 | %B = global short 8 | ||||
7 | |||||
8 | implementation | ||||
9 | |||||
10 | short %test(int *%P) { | ||||
11 | %X = load short* %B | ||||
12 | store int 7, int* %P | ||||
13 | %Y = load short* %B | ||||
14 | %Z = sub short %Y, %X | ||||
15 | ret short %Z | ||||
16 | } | ||||
17 |