brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · eb1ebc0 Raw
46 lines · plain
1// Address: https://github.com/llvm/llvm-project/issues/602752//3// RUN: rm -rf %t4// RUN: mkdir -p %t5// RUN: split-file %s %t6//7// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple -emit-module-interface %t/a.cppm -o %t/a.pcm8// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/b.cpp -fmodule-file=a=%t/a.pcm -emit-llvm -o - | FileCheck %t/b.cpp9 10// Test again with reduced BMI11// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple -emit-reduced-module-interface %t/a.cppm -o %t/a.pcm12// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/b.cpp -fmodule-file=a=%t/a.pcm -emit-llvm -o - | FileCheck %t/b.cpp13 14//--- foo.h15 16consteval void global() {}17 18//--- a.cppm19module;20#include "foo.h"21export module a;22 23//--- b.cpp24#include "foo.h"25import a;26 27consteval int b() {28	return 0;29}30 31struct bb {32	int m = b();33};34 35void bbb() {36	bb x;37}38 39// CHECK: define{{.*}}_ZN2bbC2Ev({{.*}}[[THIS:%.+]])40// CHECK-NEXT: entry:41// CHECK-NEXT:   [[THIS_ADDR:%.*]] = alloca ptr42// CHECK-NEXT:   store ptr [[THIS]], ptr [[THIS_ADDR]]43// CHECK-NEXT:   [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]]44// CHECK-NEXT:   [[M_ADDR:%.*]] = getelementptr{{.*}}%struct.bb, ptr [[THIS1]], i32 0, i32 045// CHECK-NEXT:   store i32 0, ptr [[M_ADDR]]46