xref: /aosp_15_r20/external/llvm/test/Transforms/InstCombine/2007-09-10-AliasConstFold.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -instcombine -S | grep icmp
2*9880d681SAndroid Build Coastguard Worker; PR1646
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker@__gthrw_pthread_cancel = weak alias i32 (i32), i32 (i32)* @pthread_cancel		; <i32 (i32)*> [#uses=1]
5*9880d681SAndroid Build Coastguard Worker@__gthread_active_ptr.5335 = internal constant i8* bitcast (i32 (i32)* @__gthrw_pthread_cancel to i8*)		; <i8**> [#uses=1]
6*9880d681SAndroid Build Coastguard Workerdefine weak i32 @pthread_cancel(i32) {
7*9880d681SAndroid Build Coastguard Worker       ret i32 0
8*9880d681SAndroid Build Coastguard Worker}
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Workerdefine i1 @__gthread_active_p() {
11*9880d681SAndroid Build Coastguard Workerentry:
12*9880d681SAndroid Build Coastguard Worker	%tmp1 = load i8*, i8** @__gthread_active_ptr.5335, align 4		; <i8*> [#uses=1]
13*9880d681SAndroid Build Coastguard Worker	%tmp2 = icmp ne i8* %tmp1, null		; <i1> [#uses=1]
14*9880d681SAndroid Build Coastguard Worker	ret i1 %tmp2
15*9880d681SAndroid Build Coastguard Worker}
16