brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 72da8a3 Raw
38 lines · plain
1// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py2// Check that the CHECK lines are generated before the definition and not the declaration3// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu %s -emit-llvm -o - | FileCheck %s4 5int foo(int arg);6 7void empty_function(void);8 9// CHECK-LABEL: @main(10// CHECK-NEXT:  entry:11// CHECK-NEXT:    [[RETVAL:%.*]] = alloca i32, align 412// CHECK-NEXT:    store i32 0, ptr [[RETVAL]], align 413// CHECK-NEXT:    call void @empty_function()14// CHECK-NEXT:    [[CALL:%.*]] = call i32 @foo(i32 noundef 1)15// CHECK-NEXT:    ret i32 [[CALL]]16//17int main(void) {18  empty_function();19  return foo(1);20}21 22// CHECK-LABEL: @foo(23// CHECK-NEXT:  entry:24// CHECK-NEXT:    [[ARG_ADDR:%.*]] = alloca i32, align 425// CHECK-NEXT:    store i32 [[ARG:%.*]], ptr [[ARG_ADDR]], align 426// CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr [[ARG_ADDR]], align 427// CHECK-NEXT:    ret i32 [[TMP0]]28//29int foo(int arg) {30  return arg;31}32 33// CHECK-LABEL: @empty_function(34// CHECK-NEXT:  entry:35// CHECK-NEXT:    ret void36//37void empty_function(void) {}38