xref: /aosp_15_r20/external/llvm/test/Assembler/2002-04-29-NameBinding.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; There should be NO references to the global v1.  The local v1 should
2*9880d681SAndroid Build Coastguard Worker; have all of the references!
3*9880d681SAndroid Build Coastguard Worker;
4*9880d681SAndroid Build Coastguard Worker; Check by running globaldce, which will remove the constant if there are
5*9880d681SAndroid Build Coastguard Worker; no references to it!
6*9880d681SAndroid Build Coastguard Worker;
7*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -globaldce -S | \
8*9880d681SAndroid Build Coastguard Worker; RUN:   not grep constant
9*9880d681SAndroid Build Coastguard Worker;
10*9880d681SAndroid Build Coastguard Worker; RUN: verify-uselistorder %s
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker@v1 = internal constant i32 5
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Workerdefine i32 @createtask() {
15*9880d681SAndroid Build Coastguard Worker        %v1 = alloca i32                ;; Alloca should have one use!
16*9880d681SAndroid Build Coastguard Worker        %reg112 = load i32, i32* %v1         ;; This load should not use the global!
17*9880d681SAndroid Build Coastguard Worker        ret i32 %reg112
18*9880d681SAndroid Build Coastguard Worker}
19*9880d681SAndroid Build Coastguard Worker
20