[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / llvm / test / Transforms / SCCP / apint-bigint2.ll
blobb8b5f80d5067ae1c36fd39c3c12831d8bd753a17
1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=sccp -S | FileCheck %s
4 @Y = constant [6 x i101] [ i101 12, i101 123456789000000, i101 -12,
5   i101 -123456789000000, i101 0,i101 9123456789000000]
7 define i101 @array() {
8 ; CHECK-LABEL: @array(
9 ; CHECK-NEXT:    ret i101 123456789000000
11   %A = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 1
12   %B = load i101, i101* %A
13   %D = and i101 %B, 1
14   %DD = or i101 %D, 1
15   %E = trunc i101 %DD to i32
16   %F = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 %E
17   %G = load i101, i101* %F
19   ret i101 %G
22 define i101 @large_aggregate() {
23 ; CHECK-LABEL: @large_aggregate(
24 ; CHECK-NEXT:    [[D:%.*]] = and i101 undef, 1
25 ; CHECK-NEXT:    [[DD:%.*]] = or i101 [[D]], 1
26 ; CHECK-NEXT:    [[G:%.*]] = getelementptr i101, i101* getelementptr inbounds ([6 x i101], [6 x i101]* @Y, i32 0, i32 5), i101 [[DD]]
27 ; CHECK-NEXT:    [[L3:%.*]] = load i101, i101* [[G]], align 4
28 ; CHECK-NEXT:    ret i101 [[L3]]
30   %B = load i101, i101* undef
31   %D = and i101 %B, 1
32   %DD = or i101 %D, 1
33   %F = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 5
34   %G = getelementptr i101, i101* %F, i101 %DD
35   %L3 = load i101, i101* %G
36   ret i101 %L3
39 define i101 @large_aggregate_2() {
40 ; CHECK-LABEL: @large_aggregate_2(
41 ; CHECK-NEXT:    [[D:%.*]] = and i101 undef, 1
42 ; CHECK-NEXT:    [[DD:%.*]] = or i101 [[D]], 1
43 ; CHECK-NEXT:    [[G:%.*]] = getelementptr i101, i101* getelementptr inbounds ([6 x i101], [6 x i101]* @Y, i32 0, i32 5), i101 [[DD]]
44 ; CHECK-NEXT:    [[L3:%.*]] = load i101, i101* [[G]], align 4
45 ; CHECK-NEXT:    ret i101 [[L3]]
47   %D = and i101 undef, 1
48   %DD = or i101 %D, 1
49   %F = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 5
50   %G = getelementptr i101, i101* %F, i101 %DD
51   %L3 = load i101, i101* %G
52   ret i101 %L3
55 define void @index_too_large() {
56 ; CHECK-LABEL: @index_too_large(
57 ; CHECK-NEXT:    store i101* getelementptr ([6 x i101], [6 x i101]* @Y, i101 1537416322793603071, i101 4), i101** undef, align 8
58 ; CHECK-NEXT:    ret void
60   %ptr1 = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 -1
61   %ptr2 = getelementptr i101, i101* %ptr1, i101 9224497936761618431
62   store i101* %ptr2, i101** undef
63   ret void
66 ; OSS-Fuzz #39197
67 ; https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39197
68 @0 = external dso_local unnamed_addr constant [16 x i8]
69 define void @ossfuzz_39197() {
70 ; CHECK-LABEL: @ossfuzz_39197(
71 ; CHECK-NEXT:  entry:
72 ; CHECK-NEXT:    ret void
74 entry:
75   %B5 = or i72 0, 2361183241434822606847
76   %i = add nuw nsw i72 %B5, 0
77   %i1 = lshr i72 %i, 1
78   %i2 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* bitcast ([16 x i8]* @0 to [4 x [4 x i8]]*), i72 0, i72 0, i72 %i1
79   ret void