1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature
2 ; Test that update_test_checks.py can run pre-processing commands.
3 ; RUN: opt < %s -passes=instsimplify -S | FileCheck %s --check-prefix=CHECK-AS200
4 ; RUN: sed -e 's/addrspace(200)/addrspace(0)/g' -e 's/-A200-P200-G200//g' %s \
5 ; RUN: | opt -passes=instsimplify -S | FileCheck %s --check-prefix=CHECK-AS0
6 ; Check that multiple pre-processing commands are handled
7 ; RUN: sed 's/addrspace(200)/addrspace(1)/g' %s | sed 's/-A1-P1-G1//g' \
8 ; RUN: | opt -passes=instsimplify -S | FileCheck %s --check-prefix=CHECK-AS1
9 ; More than two commands should also be fine
10 ; RUN: cat %s | cat | cat | cat | opt < %s -passes=instsimplify -S \
11 ; RUN: | FileCheck %s --check-prefix=CHECK-AS200-NOOP-PRE-PROCESS
13 target datalayout = "e-m:e-p200:128:128:128:64-p:64:64-A200-P200-G200"
15 define ptr addrspace(200) @test_zerogep_in_different_as(ptr addrspace(200) %arg) addrspace(200) nounwind {
16 ; CHECK-AS200-LABEL: define {{[^@]+}}@test_zerogep_in_different_as
17 ; CHECK-AS200-SAME: (ptr addrspace(200) [[ARG:%.*]]) addrspace(200) #[[ATTR0:[0-9]+]] {
18 ; CHECK-AS200-NEXT: entry:
19 ; CHECK-AS200-NEXT: ret ptr addrspace(200) [[ARG]]
21 ; CHECK-AS0-LABEL: define {{[^@]+}}@test_zerogep_in_different_as
22 ; CHECK-AS0-SAME: (ptr [[ARG:%.*]]) #[[ATTR0:[0-9]+]] {
23 ; CHECK-AS0-NEXT: entry:
24 ; CHECK-AS0-NEXT: ret ptr [[ARG]]
26 ; CHECK-AS1-LABEL: define {{[^@]+}}@test_zerogep_in_different_as
27 ; CHECK-AS1-SAME: (ptr addrspace(1) [[ARG:%.*]]) addrspace(1) #[[ATTR0:[0-9]+]] {
28 ; CHECK-AS1-NEXT: entry:
29 ; CHECK-AS1-NEXT: ret ptr addrspace(1) [[ARG]]
31 ; CHECK-AS200-NOOP-PRE-PROCESS-LABEL: define {{[^@]+}}@test_zerogep_in_different_as
32 ; CHECK-AS200-NOOP-PRE-PROCESS-SAME: (ptr addrspace(200) [[ARG:%.*]]) addrspace(200) #[[ATTR0:[0-9]+]] {
33 ; CHECK-AS200-NOOP-PRE-PROCESS-NEXT: entry:
34 ; CHECK-AS200-NOOP-PRE-PROCESS-NEXT: ret ptr addrspace(200) [[ARG]]
37 ret ptr addrspace(200) %arg