1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 2; RUN: opt < %s -basicaa -newgvn -S | FileCheck %s 3; PR4189 4@G = external constant [4 x i32] 5 6define i32 @test(i8* %p, i32 %i) nounwind { 7; CHECK-LABEL: @test( 8; CHECK-NEXT: entry: 9; CHECK-NEXT: [[P:%.*]] = getelementptr [4 x i32], [4 x i32]* @G, i32 0, i32 [[I:%.*]] 10; CHECK-NEXT: store i8 4, i8* [[P:%.*]] 11; CHECK-NEXT: ret i32 0 12; 13entry: 14 %P = getelementptr [4 x i32], [4 x i32]* @G, i32 0, i32 %i 15 %A = load i32, i32* %P 16 store i8 4, i8* %p 17 %B = load i32, i32* %P 18 %C = sub i32 %A, %B 19 ret i32 %C 20} 21 22