Clang Project

clang_source_code/test/CodeGen/x86-bswap.c
1// RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-apple-darwin -emit-llvm -o - | FileCheck %s
2
3#include <x86intrin.h>
4
5int test__bswapd(int X) {
6// CHECK-LABEL: @test__bswapd
7// CHECK: call i32 @llvm.bswap.i32
8  return __bswapd(X);
9}
10
11int test_bswap(int X) {
12// CHECK-LABEL: @test_bswap
13// CHECK: call i32 @llvm.bswap.i32
14  return _bswap(X);
15}
16
17long test__bswapq(long long X) {
18// CHECK-LABEL: @test__bswapq
19// CHECK: call i64 @llvm.bswap.i64
20  return __bswapq(X);
21}
22
23long test_bswap64(long long X) {
24// CHECK-LABEL: @test_bswap64
25// CHECK: call i64 @llvm.bswap.i64
26  return _bswap64(X);
27}
28
29
30