void test1(int x) {
  if ((0 << x) != 0 || (1 << x) != 2 || (2 << x) != 4 || (3 << x) != 6 ||
      (4 << x) != 8 || (5 << x) != 10 || (6 << x) != 12 || (7 << x) != 14 ||
      (8 << x) != 16 || (9 << x) != 18 || (10 << x) != 20)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
shl    %cl,%eax
cmp    $0x0,%eax
jne    11e9 <test1+0xd9>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    $0x2,%eax
jne    11e9 <test1+0xd9>
mov    -0x4(%rbp),%ecx
mov    $0x2,%eax
shl    %cl,%eax
cmp    $0x4,%eax
jne    11e9 <test1+0xd9>
mov    -0x4(%rbp),%ecx
mov    $0x3,%eax
shl    %cl,%eax
cmp    $0x6,%eax
jne    11e9 <test1+0xd9>
mov    -0x4(%rbp),%ecx
mov    $0x4,%eax
shl    %cl,%eax
cmp    $0x8,%eax
jne    11e9 <test1+0xd9>
mov    -0x4(%rbp),%ecx
mov    $0x5,%eax
shl    %cl,%eax
cmp    $0xa,%eax
jne    11e9 <test1+0xd9>
mov    -0x4(%rbp),%ecx
mov    $0x6,%eax
shl    %cl,%eax
cmp    $0xc,%eax
jne    11e9 <test1+0xd9>
mov    -0x4(%rbp),%ecx
mov    $0x7,%eax
shl    %cl,%eax
cmp    $0xe,%eax
jne    11e9 <test1+0xd9>
mov    -0x4(%rbp),%ecx
mov    $0x8,%eax
shl    %cl,%eax
cmp    $0x10,%eax
jne    11e9 <test1+0xd9>
mov    -0x4(%rbp),%ecx
mov    $0x9,%eax
shl    %cl,%eax
cmp    $0x12,%eax
jne    11e9 <test1+0xd9>
mov    -0x4(%rbp),%ecx
mov    $0xa,%eax
shl    %cl,%eax
cmp    $0x14,%eax
je     11ee <test1+0xde>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
cmp    $0x1,%edi
jne    1116 <test1+0x6>
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @test1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 0, %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %46, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = shl i32 1, %7
%9 = icmp ne i32 %8, 2
br i1 %9, label %46, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = shl i32 2, %11
%13 = icmp ne i32 %12, 4
br i1 %13, label %46, label %14
14: ; preds = %10
%15 = load i32, i32* %2
%16 = shl i32 3, %15
%17 = icmp ne i32 %16, 6
br i1 %17, label %46, label %18
18: ; preds = %14
%19 = load i32, i32* %2
%20 = shl i32 4, %19
%21 = icmp ne i32 %20, 8
br i1 %21, label %46, label %22
22: ; preds = %18
%23 = load i32, i32* %2
%24 = shl i32 5, %23
%25 = icmp ne i32 %24, 10
br i1 %25, label %46, label %26
26: ; preds = %22
%27 = load i32, i32* %2
%28 = shl i32 6, %27
%29 = icmp ne i32 %28, 12
br i1 %29, label %46, label %30
30: ; preds = %26
%31 = load i32, i32* %2
%32 = shl i32 7, %31
%33 = icmp ne i32 %32, 14
br i1 %33, label %46, label %34
34: ; preds = %30
%35 = load i32, i32* %2
%36 = shl i32 8, %35
%37 = icmp ne i32 %36, 16
br i1 %37, label %46, label %38
38: ; preds = %34
%39 = load i32, i32* %2
%40 = shl i32 9, %39
%41 = icmp ne i32 %40, 18
br i1 %41, label %46, label %42
42: ; preds = %38
%43 = load i32, i32* %2
%44 = shl i32 10, %43
%45 = icmp ne i32 %44, 20
br i1 %45, label %46, label %47
46: ; preds = %42, %38, %34, %30, %26, %22, %18, %14, %10, %6, %1
unreachable
47: ; preds = %42
ret void
}

LLVM IR (-O2):
define void @test1(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void @abort()
unreachable
4: ; preds = %1
ret void
}