1 ; RUN: llvm-as < %s | llvm-dis | FileCheck %s 2 3 @X = external global i8 4 @Y = external global i8 5 @Z = external global i8 6 7 @A = global i1 add (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) 8 ; CHECK: @A = global i1 xor (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) 9 @B = global i1 sub (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)), align 2 10 ; CHECK: @B = global i1 xor (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) 11 @C = global i1 mul (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) 12 ; CHECK: @C = global i1 and (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) 13 14 @D = global i1 sdiv (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) 15 ; CHECK: @D = global i1 icmp ult (i8* @X, i8* @Y) 16 @E = global i1 udiv (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) 17 ; CHECK: @E = global i1 icmp ult (i8* @X, i8* @Y) 18 @F = global i1 srem (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) 19 ; CHECK: @F = global i1 false 20 @G = global i1 urem (i1 icmp ult (i8* @X, i8* @Y), i1 icmp ult (i8* @X, i8* @Z)) 21 ; CHECK: @G = global i1 false 22 23 @H = global i1 icmp ule (i32* bitcast (i8* @X to i32*), i32* bitcast (i8* @Y to i32*)) 24 ; CHECK: @H = global i1 icmp ule (i8* @X, i8* @Y) 25 26 @I = global i1 xor (i1 icmp ult (i8* @X, i8* @Y), i1 false) 27 ; CHECK: @I = global i1 icmp ult (i8* @X, i8* @Y) 28 @J = global i1 xor (i1 icmp ult (i8* @X, i8* @Y), i1 true) 29 ; CHECK: @J = global i1 icmp uge (i8* @X, i8* @Y) 30 31 @K = global i1 icmp eq (i1 icmp ult (i8* @X, i8* @Y), i1 false) 32 ; CHECK: @K = global i1 icmp uge (i8* @X, i8* @Y) 33 @L = global i1 icmp eq (i1 icmp ult (i8* @X, i8* @Y), i1 true) 34 ; CHECK: @L = global i1 icmp ult (i8* @X, i8* @Y) 35 @M = global i1 icmp ne (i1 icmp ult (i8* @X, i8* @Y), i1 true) 36 ; CHECK: @M = global i1 icmp uge (i8* @X, i8* @Y) 37 @N = global i1 icmp ne (i1 icmp ult (i8* @X, i8* @Y), i1 false) 38 ; CHECK: @N = global i1 icmp ult (i8* @X, i8* @Y) 39 40 @O = global i1 icmp eq (i32 zext (i1 icmp ult (i8* @X, i8* @Y) to i32), i32 0) 41 ; CHECK: @O = global i1 icmp uge (i8* @X, i8* @Y) 42 43 44 45 ; PR5176 46 47 ; CHECK: @T1 = global i1 true 48 @T1 = global i1 icmp eq (i64 and (i64 trunc (i256 lshr (i256 or (i256 and (i256 and (i256 shl (i256 zext (i64 ptrtoint (i1* @B to i64) to i256), i256 64), i256 -6277101735386680763495507056286727952638980837032266301441), i256 6277101735386680763835789423207666416102355444464034512895), i256 shl (i256 zext (i64 ptrtoint (i1* @A to i64) to i256), i256 192)), i256 64) to i64), i64 1), i64 0) 49 50 ; CHECK: @T2 = global i1* @B 51 @T2 = global i1* inttoptr (i64 add (i64 trunc (i256 lshr (i256 or (i256 and (i256 and (i256 shl (i256 zext (i64 ptrtoint (i1* @A to i64) to i256), i256 64), i256 -6277101735386680763495507056286727952638980837032266301441), i256 6277101735386680763835789423207666416102355444464034512895), i256 shl (i256 zext (i64 ptrtoint (i1* @B to i64) to i256), i256 192)), i256 192) to i64), i64 trunc (i256 lshr (i256 or (i256 and (i256 and (i256 shl (i256 zext (i64 ptrtoint (i1* @A to i64) to i256), i256 64), i256 -6277101735386680763495507056286727952638980837032266301441), i256 6277101735386680763835789423207666416102355444464034512895), i256 shl (i256 zext (i64 ptrtoint (i1* @B to i64) to i256), i256 192)), i256 128) to i64)) to i1*) 52 53 ; CHECK: @T3 = global i64 add (i64 ptrtoint (i1* @B to i64), i64 -1) 54 @T3 = global i64 add (i64 trunc (i256 lshr (i256 or (i256 and (i256 and (i256 shl (i256 zext (i64 ptrtoint (i1* @B to i64) to i256), i256 64), i256 -6277101735386680763495507056286727952638980837032266301441), i256 6277101735386680763835789423207666416102355444464034512895), i256 shl (i256 zext (i64 ptrtoint (i1* @A to i64) to i256), i256 192)), i256 64) to i64), i64 -1) 55 56 ; CHECK: @T4 = global i1* @B 57 @T4 = global i1* inttoptr (i64 trunc (i256 lshr (i256 or (i256 and (i256 and (i256 shl (i256 zext (i64 ptrtoint (i1* @B to i64) to i256), i256 64), i256 -6277101735386680763495507056286727952638980837032266301441), i256 6277101735386680763835789423207666416102355444464034512895), i256 shl (i256 zext (i64 ptrtoint (i1* @A to i64) to i256), i256 192)), i256 64) to i64) to i1*) 58 59 ; CHECK: @T5 = global i1* @A 60 @T5 = global i1* inttoptr (i64 add (i64 trunc (i256 lshr (i256 or (i256 and (i256 and (i256 shl (i256 zext (i64 ptrtoint (i1* @B to i64) to i256), i256 64), i256 -6277101735386680763495507056286727952638980837032266301441), i256 6277101735386680763835789423207666416102355444464034512895), i256 shl (i256 zext (i64 ptrtoint (i1* @A to i64) to i256), i256 192)), i256 192) to i64), i64 trunc (i256 lshr (i256 or (i256 and (i256 and (i256 shl (i256 zext (i64 ptrtoint (i1* @B to i64) to i256), i256 64), i256 -6277101735386680763495507056286727952638980837032266301441), i256 6277101735386680763835789423207666416102355444464034512895), i256 shl (i256 zext (i64 ptrtoint (i1* @A to i64) to i256), i256 192)), i256 128) to i64)) to i1*) 61 62 63 64 ; PR6096 65 66 ; No check line. This used to crash llvm-as. 67 @T6 = global <2 x i1> fcmp ole (<2 x float> fdiv (<2 x float> undef, <2 x float> <float 1.000000e+00, float 1.000000e+00>), <2 x float> zeroinitializer) 68 69 70 ; PR9011 71 72 @pr9011_1 = constant <4 x i32> zext (<4 x i8> zeroinitializer to <4 x i32>) 73 ; CHECK: pr9011_1 = constant <4 x i32> zeroinitializer 74 @pr9011_2 = constant <4 x i32> sext (<4 x i8> zeroinitializer to <4 x i32>) 75 ; CHECK: pr9011_2 = constant <4 x i32> zeroinitializer 76 @pr9011_3 = constant <4 x i32> bitcast (<16 x i8> zeroinitializer to <4 x i32>) 77 ; CHECK: pr9011_3 = constant <4 x i32> zeroinitializer 78 @pr9011_4 = constant <4 x float> uitofp (<4 x i8> zeroinitializer to <4 x float>) 79 ; CHECK: pr9011_4 = constant <4 x float> zeroinitializer 80 @pr9011_5 = constant <4 x float> sitofp (<4 x i8> zeroinitializer to <4 x float>) 81 ; CHECK: pr9011_5 = constant <4 x float> zeroinitializer 82 @pr9011_6 = constant <4 x i32> fptosi (<4 x float> zeroinitializer to <4 x i32>) 83 ; CHECK: pr9011_6 = constant <4 x i32> zeroinitializer 84 @pr9011_7 = constant <4 x i32> fptoui (<4 x float> zeroinitializer to <4 x i32>) 85 ; CHECK: pr9011_7 = constant <4 x i32> zeroinitializer 86 @pr9011_8 = constant <4 x float> fptrunc (<4 x double> zeroinitializer to <4 x float>) 87 ; CHECK: pr9011_8 = constant <4 x float> zeroinitializer 88 @pr9011_9 = constant <4 x double> fpext (<4 x float> zeroinitializer to <4 x double>) 89 ; CHECK: pr9011_9 = constant <4 x double> zeroinitializer 90 91 @pr9011_10 = constant <4 x double> bitcast (i256 0 to <4 x double>) 92 ; CHECK: pr9011_10 = constant <4 x double> zeroinitializer 93 @pr9011_11 = constant <4 x float> bitcast (i128 0 to <4 x float>) 94 ; CHECK: pr9011_11 = constant <4 x float> zeroinitializer 95 @pr9011_12 = constant <4 x i32> bitcast (i128 0 to <4 x i32>) 96 ; CHECK: pr9011_12 = constant <4 x i32> zeroinitializer 97 @pr9011_13 = constant i256 bitcast (<4 x double> zeroinitializer to i256) 98 ; CHECK: pr9011_13 = constant i256 0 99 @pr9011_14 = constant i128 bitcast (<4 x float> zeroinitializer to i128) 100 ; CHECK: pr9011_14 = constant i128 0 101 @pr9011_15 = constant i128 bitcast (<4 x i32> zeroinitializer to i128) 102 ; CHECK: pr9011_15 = constant i128 0 103 104 @select = internal constant 105 i32 select (i1 icmp ult (i32 ptrtoint (i8* @X to i32), 106 i32 ptrtoint (i8* @Y to i32)), 107 i32 select (i1 icmp ult (i32 ptrtoint (i8* @X to i32), 108 i32 ptrtoint (i8* @Y to i32)), 109 i32 10, i32 20), 110 i32 30) 111 ; CHECK: select = internal constant i32 select {{.*}} i32 10, i32 30 112