1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // Example input for update_cc_test_checks
3 // RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
7 // CHECK-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
8 // CHECK-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
9 // CHECK-NEXT: store i64 [[A:%.*]], ptr [[A_ADDR]], align 8
10 // CHECK-NEXT: store i32 [[B:%.*]], ptr [[B_ADDR]], align 4
11 // CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A_ADDR]], align 8
12 // CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[B_ADDR]], align 4
13 // CHECK-NEXT: [[CONV:%.*]] = sext i32 [[TMP1]] to i64
14 // CHECK-NEXT: [[ADD:%.*]] = add nsw i64 [[TMP0]], [[CONV]]
15 // CHECK-NEXT: ret i64 [[ADD]]
17 long test(long a, int b) {
21 // A function with a mangled name
22 // CHECK-LABEL: @_Z4testlii(
24 // CHECK-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
25 // CHECK-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
26 // CHECK-NEXT: [[C_ADDR:%.*]] = alloca i32, align 4
27 // CHECK-NEXT: store i64 [[A:%.*]], ptr [[A_ADDR]], align 8
28 // CHECK-NEXT: store i32 [[B:%.*]], ptr [[B_ADDR]], align 4
29 // CHECK-NEXT: store i32 [[C:%.*]], ptr [[C_ADDR]], align 4
30 // CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[A_ADDR]], align 8
31 // CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[B_ADDR]], align 4
32 // CHECK-NEXT: [[CONV:%.*]] = sext i32 [[TMP1]] to i64
33 // CHECK-NEXT: [[ADD:%.*]] = add nsw i64 [[TMP0]], [[CONV]]
34 // CHECK-NEXT: [[TMP2:%.*]] = load i32, ptr [[C_ADDR]], align 4
35 // CHECK-NEXT: [[CONV1:%.*]] = sext i32 [[TMP2]] to i64
36 // CHECK-NEXT: [[ADD2:%.*]] = add nsw i64 [[ADD]], [[CONV1]]
37 // CHECK-NEXT: ret i64 [[ADD2]]
39 __attribute__((overloadable)) long test(long a, int b, int c) {