1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-globals --global-value-regex ".*"
2 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -emit-llvm -o - %s | FileCheck %s
5 // CHECK: @__aarch64_cpu_features = external dso_local global { i64 }
9 // CHECK-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
10 // CHECK-NEXT: store i32 0, ptr [[RETVAL]], align 4
11 // CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
12 // CHECK-NEXT: [[TMP1:%.*]] = and i64 [[TMP0]], 70368744177664
13 // CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 70368744177664
14 // CHECK-NEXT: [[TMP3:%.*]] = and i1 true, [[TMP2]]
15 // CHECK-NEXT: br i1 [[TMP3]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
17 // CHECK-NEXT: store i32 1, ptr [[RETVAL]], align 4
18 // CHECK-NEXT: br label [[RETURN:%.*]]
20 // CHECK-NEXT: [[TMP4:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
21 // CHECK-NEXT: [[TMP5:%.*]] = and i64 [[TMP4]], 17867063951360
22 // CHECK-NEXT: [[TMP6:%.*]] = icmp eq i64 [[TMP5]], 17867063951360
23 // CHECK-NEXT: [[TMP7:%.*]] = and i1 true, [[TMP6]]
24 // CHECK-NEXT: br i1 [[TMP7]], label [[IF_THEN1:%.*]], label [[IF_END2:%.*]]
26 // CHECK-NEXT: store i32 2, ptr [[RETVAL]], align 4
27 // CHECK-NEXT: br label [[RETURN]]
29 // CHECK-NEXT: [[TMP8:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
30 // CHECK-NEXT: [[TMP9:%.*]] = and i64 [[TMP8]], 171136785840078848
31 // CHECK-NEXT: [[TMP10:%.*]] = icmp eq i64 [[TMP9]], 171136785840078848
32 // CHECK-NEXT: [[TMP11:%.*]] = and i1 true, [[TMP10]]
33 // CHECK-NEXT: br i1 [[TMP11]], label [[IF_THEN3:%.*]], label [[IF_END4:%.*]]
35 // CHECK-NEXT: store i32 3, ptr [[RETVAL]], align 4
36 // CHECK-NEXT: br label [[RETURN]]
38 // CHECK-NEXT: br i1 false, label [[IF_THEN5:%.*]], label [[IF_END6:%.*]]
40 // CHECK-NEXT: store i32 4, ptr [[RETVAL]], align 4
41 // CHECK-NEXT: br label [[RETURN]]
43 // CHECK-NEXT: store i32 0, ptr [[RETVAL]], align 4
44 // CHECK-NEXT: br label [[RETURN]]
46 // CHECK-NEXT: [[TMP12:%.*]] = load i32, ptr [[RETVAL]], align 4
47 // CHECK-NEXT: ret i32 [[TMP12]]
50 if (__builtin_cpu_supports("sb"))
53 if (__builtin_cpu_supports("sve2-aes+memtag"))
56 if (__builtin_cpu_supports("sme2+ls64+wfxt"))
59 if (__builtin_cpu_supports("avx2"))
65 // CHECK: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
66 // CHECK: [[META1:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"}