brintos

brintos / llvm-project-archived public Read only

0
0
Text · 9.9 KiB · 52073dd Raw
172 lines · c
1// RUN: echo "int main() { return __builtin_cpu_supports(\"4xxmac\");}" > %t.c2// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=0 %s3 4// RUN: echo "int main() { return __builtin_cpu_supports(\"altivec\");}" > %t.c5// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck %s -DPOS=46 -DOP=ugt -DBIT=i32 -DVALUE=0 \6// RUN:   --check-prefixes=CHECKOP,OPRT,SYSCONF7 8// RUN: echo "int main() { return __builtin_cpu_supports(\"archpmu\");}" > %t.c9// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=0 %s10 11// RUN: echo "int main() { return __builtin_cpu_supports(\"booke\");}" > %t.c12// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=0 %s13 14// RUN: echo "int main() { return __builtin_cpu_supports(\"cellbe\");}" > %t.c15// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=0 %s16 17// RUN: echo "int main() { return __builtin_cpu_supports(\"darn\");}" > %t.c18// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck %s -DPOS=1 -DOP=uge -DBIT=i32 -DVALUE=131072 \19// RUN:   --check-prefixes=CHECKOP,OPRT,SYSCONF20 21// RUN: echo "int main() { return __builtin_cpu_supports(\"dscr\");}" > %t.c22// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck %s -DPOS=1 -DOP=uge -DBIT=i32 -DVALUE=65536 \23// RUN:   --check-prefixes=CHECKOP,OPRT,SYSCONF24 25// RUN: echo "int main() { return __builtin_cpu_supports(\"ebb\");}" > %t.c26// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck %s -DPOS=1 -DOP=uge -DBIT=i32 -DVALUE=65536 \27// RUN:   --check-prefixes=CHECKOP,OPRT,SYSCONF28 29// RUN: echo "int main() { return __builtin_cpu_supports(\"efpdouble\");}" > %t.c30// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=0 %s31 32// RUN: echo "int main() { return __builtin_cpu_supports(\"efpsingle\");}" > %t.c33// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=0 %s34 35// RUN: echo "int main() { return __builtin_cpu_supports(\"pa6t\");}" > %t.c36// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=0 %s37 38// RUN: echo "int main() { return __builtin_cpu_supports(\"fpu\");}" > %t.c39// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=1 %s40 41// RUN: echo "int main() { return __builtin_cpu_supports(\"htm\");}" > %t.c42// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck %s -DPOS=1 -DOP=ugt -DLABLE=59  -DBIT=i64 -DVALUE=0 \43// RUN:   --check-prefixes=CHECKOP,OPRT,SYSCALL44 45// RUN: echo "int main() { return __builtin_cpu_supports(\"htm-nosc\");}" > %t.c46// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=0 %s47 48// RUN: echo "int main() { return __builtin_cpu_supports(\"htm-no-suspend\");}" > %t.c49// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=0 %s50 51// RUN: echo "int main() { return __builtin_cpu_supports(\"ic_snoop\");}" > %t.c52// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=0 %s53 54// RUN: echo "int main() { return __builtin_cpu_supports(\"isel\");}" > %t.c55// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=1 %s56 57// RUN: echo "int main() { return __builtin_cpu_supports(\"mma\");}" > %t.c58// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck %s -DPOS=1 -DOP=ugt -DLABLE=62 -DBIT=i64 -DVALUE=0 \59// RUN:   --check-prefixes=CHECKOP,OPRT,SYSCALL60 61// RUN: echo "int main() { return __builtin_cpu_supports(\"mmu\");}" > %t.c62// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=1 %s63 64// RUN: echo "int main() { return __builtin_cpu_supports(\"notb\");}" > %t.c65// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=0 %s66 67// RUN: echo "int main() { return __builtin_cpu_supports(\"arch_2_05\");}" > %t.c68// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=1 %s69 70// RUN: echo "int main() { return __builtin_cpu_supports(\"arch_2_06\");}" > %t.c71// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck %s -DPOS=1 -DOP=uge -DBIT=i32 -DVALUE=32768 \72// RUN:   --check-prefixes=CHECKOP,OPRT,SYSCONF73 74// RUN: echo "int main() { return __builtin_cpu_supports(\"arch_2_07\");}" > %t.c75// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck %s -DPOS=1 -DOP=uge -DBIT=i32 -DVALUE=65536 \76// RUN:   --check-prefixes=CHECKOP,OPRT,SYSCONF77 78// RUN: echo "int main() { return __builtin_cpu_supports(\"arch_3_00\");}" > %t.c79// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck %s -DPOS=1 -DOP=uge -DBIT=i32 -DVALUE=131072 \80// RUN:   --check-prefixes=CHECKOP,OPRT,SYSCONF81 82// RUN: echo "int main() { return __builtin_cpu_supports(\"arch_3_1\");}" > %t.c83// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck %s -DPOS=1 -DOP=uge -DBIT=i32 -DVALUE=262144 \84// RUN:   --check-prefixes=CHECKOP,OPRT,SYSCONF85 86// RUN: echo "int main() { return __builtin_cpu_supports(\"dfp\");}" > %t.c87// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck %s -DPOS=53 -DOP=ne -DBIT=i32 -DVALUE=0 \88// RUN:   --check-prefixes=CHECKOP,OPRT,SYSCONF89 90// RUN: echo "int main() { return __builtin_cpu_supports(\"power4\");}" > %t.c91// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=1 %s92 93// RUN: echo "int main() { return __builtin_cpu_supports(\"power5\");}" > %t.c94// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=1 %s95 96// RUN: echo "int main() { return __builtin_cpu_supports(\"power5+\");}" > %t.c97// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=1 %s98 99// RUN: echo "int main() { return __builtin_cpu_supports(\"power6x\");}" > %t.c100// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=0 %s101 102// RUN: echo "int main() { return __builtin_cpu_supports(\"ppc32\");}" > %t.c103// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=1 %s104 105// RUN: echo "int main() { return __builtin_cpu_supports(\"ppc601\");}" > %t.c106// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=0 %s107 108// RUN: echo "int main() { return __builtin_cpu_supports(\"ppc64\");}" > %t.c109// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=1 %s110 111// RUN: echo "int main() { return __builtin_cpu_supports(\"ppcle\");}" > %t.c112// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=0 %s113 114// RUN: echo "int main() { return __builtin_cpu_supports(\"smt\");}" > %t.c115// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck %s -DPOS=44 -DMASK=3 -DOP=eq -DBIT=i32 -DVALUE=3 \116// RUN:   --check-prefixes=CHECKOP,OPMASK,SYSCONF117 118// RUN: echo "int main() { return __builtin_cpu_supports(\"spe\");}" > %t.c119// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=0 %s120 121// RUN: echo "int main() { return __builtin_cpu_supports(\"scv\");}" > %t.c122// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=0 %s123 124// RUN: echo "int main() { return __builtin_cpu_supports(\"tar\");}" > %t.c125// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck %s -DPOS=1 -DOP=uge -DBIT=i32 -DVALUE=65536 \126// RUN:   --check-prefixes=CHECKOP,OPRT,SYSCONF127 128// RUN: echo "int main() { return __builtin_cpu_supports(\"true_le\");}" > %t.c129// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=1 %s130 131// RUN: echo "int main() { return __builtin_cpu_supports(\"ucache\");}" > %t.c132// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck %s -DPOS=5 -DMASK=2 -DOP=eq -DBIT=i32 -DVALUE=2 \133// RUN:   --check-prefixes=CHECKOP,OPMASK,SYSCONF134 135// RUN: echo "int main() { return __builtin_cpu_supports(\"vcrypto\");}" > %t.c136// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck -DBOOL=0 %s137 138// RUN: echo "int main() { return __builtin_cpu_supports(\"vsx\");}" > %t.c139// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %t.c | FileCheck %s -DPOS=46 -DOP=ugt -DBIT=i32 -DVALUE=1 \140// RUN:   --check-prefixes=CHECKOP,OPRT,SYSCONF141 142// CHECK:     define i32 @main() #0 {143// CHECK-NEXT: entry:144// CHECK-NEXT:   %retval = alloca i32, align 4145// CHECK-NEXT:   store i32 0, ptr %retval, align 4146// CHECK-NEXT:   ret i32 [[BOOL]]147// CHECK-NEXT: }148 149// SYSCONF: @_system_configuration = external global { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, i32, i64, i64, i64, i64, i32, i32, i32, i32, i32, i32, i64, i32, i8, i8, i8, i8, i32, i32, i16, i16, [3 x i32], i32 }150 151// CHECKOP:   define i32 @main() #0 {152// CHECKOP-NEXT: entry:153// CHECKOP-NEXT:   %retval = alloca i32, align 4154// CHECKOP-NEXT:   store i32 0, ptr %retval, align 4155 156// SYSCONF-NEXT:   %0 = load i32, ptr getelementptr inbounds ({ i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, i32, i64, i64, i64, i64, i32, i32, i32, i32, i32, i32, i64, i32, i8, i8, i8, i8, i32, i32, i16, i16, [3 x i32], i32 }, ptr @_system_configuration, i32 0, i32 [[POS]]), align 4157// SYSCALL-NEXT:  %0 = call i64 @getsystemcfg(i32 [[LABLE]])158 159// OPRT-NEXT:  %1 = icmp [[OP]] [[BIT]] %0, [[VALUE]]160// OPRT-NEXT:     %conv = zext i1 %1 to i32161 162// OPMASK-NEXT:  %1 = and i32 %0, [[MASK]]163// OPMASK-NEXT:  %2 = icmp [[OP]] i32 %1, [[VALUE]]164// OPMASK-NEXT:  %conv = zext i1 %2 to i32165 166// CHECKOP-NEXT:   ret i32 %conv167// CHECKOP-NEXT: }168 169// SYSCALL: declare i64 @getsystemcfg(i32)170 171 172